AP_NavEKF3: use NEW_NOTHROW for new(std::nothrow)

This commit is contained in:
Andrew Tridgell 2024-05-27 11:24:13 +10:00
parent 5e88d67571
commit 94cbd7cbfb
2 changed files with 2 additions and 2 deletions

View File

@ -43,7 +43,7 @@ void NavEKF3_core::BeaconFusion::InitialiseVariables()
auto *beacon = AP::dal().beacon();
if (beacon != nullptr) {
const uint8_t count = beacon->count();
fusionReport = new BeaconFusion::FusionReport[count];
fusionReport = NEW_NOTHROW BeaconFusion::FusionReport[count];
if (fusionReport != nullptr) {
numFusionReports = count;
}

View File

@ -172,7 +172,7 @@ bool NavEKF3_core::setup_core(uint8_t _imu_index, uint8_t _core_index)
}
// try to instantiate
yawEstimator = new EKFGSF_yaw();
yawEstimator = NEW_NOTHROW EKFGSF_yaw();
if (yawEstimator == nullptr) {
GCS_SEND_TEXT(MAV_SEVERITY_CRITICAL, "EKF3 IMU%uGSF: allocation failed",(unsigned)imu_index);
return false;