From ad6502c9f192210700cf5da9673d0085689b9e7f Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Mon, 27 May 2024 11:24:13 +1000 Subject: [PATCH] APM_Control: use NEW_NOTHROW for new(std::nothrow) --- libraries/APM_Control/AP_PitchController.cpp | 2 +- libraries/APM_Control/AP_RollController.cpp | 2 +- libraries/APM_Control/AP_YawController.cpp | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/libraries/APM_Control/AP_PitchController.cpp b/libraries/APM_Control/AP_PitchController.cpp index 0dda072cdd..0bd2e9417e 100644 --- a/libraries/APM_Control/AP_PitchController.cpp +++ b/libraries/APM_Control/AP_PitchController.cpp @@ -412,7 +412,7 @@ void AP_PitchController::convert_pid() void AP_PitchController::autotune_start(void) { if (autotune == nullptr) { - autotune = new AP_AutoTune(gains, AP_AutoTune::AUTOTUNE_PITCH, aparm, rate_pid); + autotune = NEW_NOTHROW AP_AutoTune(gains, AP_AutoTune::AUTOTUNE_PITCH, aparm, rate_pid); if (autotune == nullptr) { if (!failed_autotune_alloc) { GCS_SEND_TEXT(MAV_SEVERITY_ERROR, "AutoTune: failed pitch allocation"); diff --git a/libraries/APM_Control/AP_RollController.cpp b/libraries/APM_Control/AP_RollController.cpp index 8717828cda..6f16fd2b02 100644 --- a/libraries/APM_Control/AP_RollController.cpp +++ b/libraries/APM_Control/AP_RollController.cpp @@ -313,7 +313,7 @@ void AP_RollController::convert_pid() void AP_RollController::autotune_start(void) { if (autotune == nullptr) { - autotune = new AP_AutoTune(gains, AP_AutoTune::AUTOTUNE_ROLL, aparm, rate_pid); + autotune = NEW_NOTHROW AP_AutoTune(gains, AP_AutoTune::AUTOTUNE_ROLL, aparm, rate_pid); if (autotune == nullptr) { if (!failed_autotune_alloc) { GCS_SEND_TEXT(MAV_SEVERITY_ERROR, "AutoTune: failed roll allocation"); diff --git a/libraries/APM_Control/AP_YawController.cpp b/libraries/APM_Control/AP_YawController.cpp index 15f42c2fb5..0da792112b 100644 --- a/libraries/APM_Control/AP_YawController.cpp +++ b/libraries/APM_Control/AP_YawController.cpp @@ -391,7 +391,7 @@ void AP_YawController::autotune_start(void) gains.tau.set(0.5); gains.rmax_pos.set(90); - autotune = new AP_AutoTune(gains, AP_AutoTune::AUTOTUNE_YAW, aparm, rate_pid); + autotune = NEW_NOTHROW AP_AutoTune(gains, AP_AutoTune::AUTOTUNE_YAW, aparm, rate_pid); if (autotune == nullptr) { if (!failed_autotune_alloc) { GCS_SEND_TEXT(MAV_SEVERITY_ERROR, "AutoTune: failed yaw allocation");