From 27ad9ac3cadfe8fadee131788b052b150d2ceaab Mon Sep 17 00:00:00 2001 From: Michael du Breuil Date: Thu, 4 Apr 2019 23:21:03 -0700 Subject: [PATCH] AP_GPS: Refactor get_singleton() to return a pointer --- libraries/AP_GPS/AP_GPS.cpp | 2 +- libraries/AP_GPS/AP_GPS.h | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) 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