From a71585b9b83aefe980bf94b56a19c9447572e033 Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Mon, 27 May 2024 11:24:09 +1000 Subject: [PATCH] AP_Camera: use NEW_NOTHROW for new(std::nothrow) --- libraries/AP_Camera/AP_Camera.cpp | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/libraries/AP_Camera/AP_Camera.cpp b/libraries/AP_Camera/AP_Camera.cpp index 4b2182388b..9a2deb8a18 100644 --- a/libraries/AP_Camera/AP_Camera.cpp +++ b/libraries/AP_Camera/AP_Camera.cpp @@ -201,42 +201,42 @@ void AP_Camera::init() switch ((CameraType)_params[instance].type.get()) { #if AP_CAMERA_SERVO_ENABLED case CameraType::SERVO: - _backends[instance] = new AP_Camera_Servo(*this, _params[instance], instance); + _backends[instance] = NEW_NOTHROW AP_Camera_Servo(*this, _params[instance], instance); break; #endif #if AP_CAMERA_RELAY_ENABLED case CameraType::RELAY: - _backends[instance] = new AP_Camera_Relay(*this, _params[instance], instance); + _backends[instance] = NEW_NOTHROW AP_Camera_Relay(*this, _params[instance], instance); break; #endif #if AP_CAMERA_SOLOGIMBAL_ENABLED // check for GoPro in Solo camera case CameraType::SOLOGIMBAL: - _backends[instance] = new AP_Camera_SoloGimbal(*this, _params[instance], instance); + _backends[instance] = NEW_NOTHROW AP_Camera_SoloGimbal(*this, _params[instance], instance); break; #endif #if AP_CAMERA_MOUNT_ENABLED // check for Mount camera case CameraType::MOUNT: - _backends[instance] = new AP_Camera_Mount(*this, _params[instance], instance); + _backends[instance] = NEW_NOTHROW AP_Camera_Mount(*this, _params[instance], instance); break; #endif #if AP_CAMERA_MAVLINK_ENABLED // check for MAVLink enabled camera driver case CameraType::MAVLINK: - _backends[instance] = new AP_Camera_MAVLink(*this, _params[instance], instance); + _backends[instance] = NEW_NOTHROW AP_Camera_MAVLink(*this, _params[instance], instance); break; #endif #if AP_CAMERA_MAVLINKCAMV2_ENABLED // check for MAVLink Camv2 driver case CameraType::MAVLINK_CAMV2: - _backends[instance] = new AP_Camera_MAVLinkCamV2(*this, _params[instance], instance); + _backends[instance] = NEW_NOTHROW AP_Camera_MAVLinkCamV2(*this, _params[instance], instance); break; #endif #if AP_CAMERA_SCRIPTING_ENABLED // check for Scripting driver case CameraType::SCRIPTING: - _backends[instance] = new AP_Camera_Scripting(*this, _params[instance], instance); + _backends[instance] = NEW_NOTHROW AP_Camera_Scripting(*this, _params[instance], instance); break; #endif case CameraType::NONE: