From 5f4680bf2c591df294f9de21d32119a2d8d623f1 Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Wed, 13 Dec 2017 12:06:12 +1100 Subject: [PATCH] AP_LeakDetector: 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/AP_LeakDetector/AP_LeakDetector.h | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/libraries/AP_LeakDetector/AP_LeakDetector.h b/libraries/AP_LeakDetector/AP_LeakDetector.h index 26d034189d..dafd64ae96 100644 --- a/libraries/AP_LeakDetector/AP_LeakDetector.h +++ b/libraries/AP_LeakDetector/AP_LeakDetector.h @@ -14,9 +14,7 @@ class AP_LeakDetector { friend class AP_LeakDetector_Digital; public: - static AP_LeakDetector create() { return AP_LeakDetector{}; } - - constexpr AP_LeakDetector(AP_LeakDetector &&other) = default; + AP_LeakDetector(); /* Do not allow copies */ AP_LeakDetector(const AP_LeakDetector &other) = delete; @@ -48,8 +46,6 @@ public: static const struct AP_Param::GroupInfo var_info[]; private: - AP_LeakDetector(); - AP_LeakDetector_Backend *_drivers[LEAKDETECTOR_MAX_INSTANCES]; LeakDetector_State _state[LEAKDETECTOR_MAX_INSTANCES];