From 85f9fecd24ca41975e94ff547e1e777ac77d1ce5 Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Wed, 13 Dec 2017 12:06:11 +1100 Subject: [PATCH] AC_Sprayer: removed create() method for objects See discussion here: https://github.com/ArduPilot/ardupilot/issues/7331 we were getting some uninitialised variables. While it only showed up in AP_SbusOut, it means we can't be sure it won't happen on other objects, so safest to remove the approach Thanks to assistance from Lucas, Peter and Francisco --- libraries/AC_Sprayer/AC_Sprayer.h | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/libraries/AC_Sprayer/AC_Sprayer.h b/libraries/AC_Sprayer/AC_Sprayer.h index d644bdc12d..6c024654c5 100644 --- a/libraries/AC_Sprayer/AC_Sprayer.h +++ b/libraries/AC_Sprayer/AC_Sprayer.h @@ -32,11 +32,7 @@ /// @brief Object managing a crop sprayer comprised of a spinner and a pump both controlled by pwm class AC_Sprayer { public: - static AC_Sprayer create(const AP_InertialNav *inav) { - return AC_Sprayer{inav}; - } - - constexpr AC_Sprayer(AC_Sprayer &&other) = default; + AC_Sprayer(const AP_InertialNav *inav); /* Do not allow copies */ AC_Sprayer(const AC_Sprayer &other) = delete; @@ -65,8 +61,6 @@ public: static const struct AP_Param::GroupInfo var_info[]; private: - AC_Sprayer(const AP_InertialNav *inav); - const AP_InertialNav* const _inav; ///< pointers to other objects we depend upon // parameters