diff --git a/libraries/AP_ExternalAHRS/AP_ExternalAHRS.cpp b/libraries/AP_ExternalAHRS/AP_ExternalAHRS.cpp index 7900bab825..e113eba81d 100644 --- a/libraries/AP_ExternalAHRS/AP_ExternalAHRS.cpp +++ b/libraries/AP_ExternalAHRS/AP_ExternalAHRS.cpp @@ -108,25 +108,25 @@ void AP_ExternalAHRS::init(void) #if AP_EXTERNAL_AHRS_VECTORNAV_ENABLED case DevType::VecNav: - backend = new AP_ExternalAHRS_VectorNav(this, state); + backend = NEW_NOTHROW AP_ExternalAHRS_VectorNav(this, state); return; #endif #if AP_EXTERNAL_AHRS_MICROSTRAIN5_ENABLED case DevType::MicroStrain5: - backend = new AP_ExternalAHRS_MicroStrain5(this, state); + backend = NEW_NOTHROW AP_ExternalAHRS_MicroStrain5(this, state); return; #endif #if AP_EXTERNAL_AHRS_MICROSTRAIN7_ENABLED case DevType::MicroStrain7: - backend = new AP_ExternalAHRS_MicroStrain7(this, state); + backend = NEW_NOTHROW AP_ExternalAHRS_MicroStrain7(this, state); return; #endif #if AP_EXTERNAL_AHRS_INERTIAL_LABS_ENABLED case DevType::InertialLabs: - backend = new AP_ExternalAHRS_InertialLabs(this, state); + backend = NEW_NOTHROW AP_ExternalAHRS_InertialLabs(this, state); return; #endif diff --git a/libraries/AP_ExternalAHRS/AP_ExternalAHRS_VectorNav.cpp b/libraries/AP_ExternalAHRS/AP_ExternalAHRS_VectorNav.cpp index 179f05fd9f..af207f54c6 100644 --- a/libraries/AP_ExternalAHRS/AP_ExternalAHRS_VectorNav.cpp +++ b/libraries/AP_ExternalAHRS/AP_ExternalAHRS_VectorNav.cpp @@ -183,9 +183,9 @@ AP_ExternalAHRS_VectorNav::AP_ExternalAHRS_VectorNav(AP_ExternalAHRS *_frontend, port_num = sm.find_portnum(AP_SerialManager::SerialProtocol_AHRS, 0); bufsize = MAX(MAX(VN_PKT1_LENGTH, VN_PKT2_LENGTH), VN_100_PKT1_LENGTH); - pktbuf = new uint8_t[bufsize]; - last_pkt1 = new VN_packet1; - last_pkt2 = new VN_packet2; + pktbuf = NEW_NOTHROW uint8_t[bufsize]; + last_pkt1 = NEW_NOTHROW VN_packet1; + last_pkt2 = NEW_NOTHROW VN_packet2; if (!pktbuf || !last_pkt1 || !last_pkt2) { AP_BoardConfig::allocation_error("VectorNav ExternalAHRS");