diff --git a/libraries/AC_AutoTune/AC_AutoTune_FreqResp.cpp b/libraries/AC_AutoTune/AC_AutoTune_FreqResp.cpp index 5c5105e1da..804b580091 100644 --- a/libraries/AC_AutoTune/AC_AutoTune_FreqResp.cpp +++ b/libraries/AC_AutoTune/AC_AutoTune_FreqResp.cpp @@ -306,8 +306,8 @@ void AC_AutoTune_FreqResp::set_dwell_cycles(uint8_t cycles) { dwell_cycles = cycles; if (meas_peak_info_buffer != nullptr) { delete meas_peak_info_buffer;} - meas_peak_info_buffer = new ObjectBuffer(cycles); + meas_peak_info_buffer = NEW_NOTHROW ObjectBuffer(cycles); if (tgt_peak_info_buffer != nullptr) { delete tgt_peak_info_buffer;} - tgt_peak_info_buffer = new ObjectBuffer(cycles); + tgt_peak_info_buffer = NEW_NOTHROW ObjectBuffer(cycles); } diff --git a/libraries/AC_AutoTune/AC_AutoTune_FreqResp.h b/libraries/AC_AutoTune/AC_AutoTune_FreqResp.h index 6afb7b4697..7da1233cba 100644 --- a/libraries/AC_AutoTune/AC_AutoTune_FreqResp.h +++ b/libraries/AC_AutoTune/AC_AutoTune_FreqResp.h @@ -12,8 +12,8 @@ public: AC_AutoTune_FreqResp() { dwell_cycles = 6; - meas_peak_info_buffer = new ObjectBuffer(dwell_cycles); - tgt_peak_info_buffer = new ObjectBuffer(dwell_cycles); + meas_peak_info_buffer = NEW_NOTHROW ObjectBuffer(dwell_cycles); + tgt_peak_info_buffer = NEW_NOTHROW ObjectBuffer(dwell_cycles); } // Enumeration of input type