AP_Notify: 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
This commit is contained in:
Andrew Tridgell 2017-12-13 12:06:13 +11:00
parent c13eaf0c7f
commit cd51c71857

View File

@ -40,19 +40,17 @@ class AP_Notify
friend class RGBLed; // RGBLed needs access to notify parameters
friend class Display; // Display needs access to notify parameters
public:
static AP_Notify create() { return AP_Notify{}; }
// get singleton instance
static AP_Notify *instance(void) {
return _instance;
}
constexpr AP_Notify(AP_Notify &&other) = default;
AP_Notify();
/* Do not allow copies */
AP_Notify(const AP_Notify &other) = delete;
AP_Notify &operator=(const AP_Notify&) = delete;
// get singleton instance
static AP_Notify *instance(void) {
return _instance;
}
// Oreo LED Themes
enum Oreo_LED_Theme {
OreoLED_Disabled = 0, // Disabled the OLED driver entirely
@ -145,8 +143,6 @@ public:
static const struct AP_Param::GroupInfo var_info[];
private:
AP_Notify();
static AP_Notify *_instance;
// parameters