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

This commit is contained in:
Andrew Tridgell 2024-05-27 11:24:15 +10:00
parent 659ecf6159
commit 20a5ec4348

View File

@ -168,13 +168,13 @@ void AP_WheelEncoder::init(void)
case WheelEncoder_TYPE_QUADRATURE:
#if CONFIG_HAL_BOARD == HAL_BOARD_CHIBIOS
drivers[i] = new AP_WheelEncoder_Quadrature(*this, i, state[i]);
drivers[i] = NEW_NOTHROW AP_WheelEncoder_Quadrature(*this, i, state[i]);
#endif
break;
case WheelEncoder_TYPE_SITL_QUADRATURE:
#if CONFIG_HAL_BOARD == HAL_BOARD_SITL
drivers[i] = new AP_WheelEncoder_SITL_Quadrature(*this, i, state[i]);
drivers[i] = NEW_NOTHROW AP_WheelEncoder_SITL_Quadrature(*this, i, state[i]);
#endif
break;