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

This commit is contained in:
Andrew Tridgell 2024-05-27 11:24:13 +10:00
parent 5ca4bdbd8d
commit 5e88d67571

View File

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