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

This commit is contained in:
Andrew Tridgell 2024-05-27 12:35:57 +10:00
parent 35a8f6c7b2
commit e97a6c7089

View File

@ -214,9 +214,9 @@ AP_InertialSensor_Backend *AP_InertialSensor_LSM9DS1::probe(AP_InertialSensor &_
}
AP_InertialSensor_LSM9DS1 *sensor =
new AP_InertialSensor_LSM9DS1(_imu,std::move(dev),
LSM9DS1_DRY_XG_PIN,
rotation);
NEW_NOTHROW AP_InertialSensor_LSM9DS1(_imu,std::move(dev),
LSM9DS1_DRY_XG_PIN,
rotation);
if (!sensor || !sensor->_init_sensor()) {
delete sensor;
return nullptr;