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

This commit is contained in:
Andrew Tridgell 2024-05-27 11:24:10 +10:00
parent 0f08b47322
commit 98caad29f5
1 changed files with 1 additions and 1 deletions

View File

@ -139,7 +139,7 @@ AP_CustomRotation* AP_CustomRotations::get_rotation(Rotation r)
} }
const uint8_t index = r - ROTATION_CUSTOM_1; const uint8_t index = r - ROTATION_CUSTOM_1;
if (rotations[index] == nullptr) { if (rotations[index] == nullptr) {
rotations[index] = new AP_CustomRotation(params[index]); rotations[index] = NEW_NOTHROW AP_CustomRotation(params[index]);
// make sure param is enabled if custom rotation is used // make sure param is enabled if custom rotation is used
enable.set_and_save_ifchanged(1); enable.set_and_save_ifchanged(1);
} }