diff --git a/libraries/AP_GPS/AP_GPS.cpp b/libraries/AP_GPS/AP_GPS.cpp index 2e2f313ece..f24f5c5a84 100644 --- a/libraries/AP_GPS/AP_GPS.cpp +++ b/libraries/AP_GPS/AP_GPS.cpp @@ -1573,7 +1573,7 @@ namespace AP { AP_GPS &gps() { - return AP_GPS::get_singleton(); + return *AP_GPS::get_singleton(); } }; diff --git a/libraries/AP_GPS/AP_GPS.h b/libraries/AP_GPS/AP_GPS.h index 7c0570f635..9308d43690 100644 --- a/libraries/AP_GPS/AP_GPS.h +++ b/libraries/AP_GPS/AP_GPS.h @@ -64,8 +64,8 @@ public: AP_GPS(const AP_GPS &other) = delete; AP_GPS &operator=(const AP_GPS&) = delete; - static AP_GPS &get_singleton() { - return *_singleton; + static AP_GPS *get_singleton() { + return _singleton; } // GPS driver types