ST / GPSProvider

Files at this revision

API Documentation at this revision

Comitter:
rgrover1
Date:
Fri Nov 07 08:24:48 2014 +0000
Parent:
3:47aaf0ebde35
Commit message:
making the destructor for GPSProvider non-virtual; moving it to GPSProvider.cpp.; The destructor should forward control to the impl.

Changed in this revision

GPSProvider.cpp Show annotated file Show diff for this revision Revisions of this file
GPSProvider.h Show annotated file Show diff for this revision Revisions of this file
GPSProviderImplBase.h Show annotated file Show diff for this revision Revisions of this file
--- a/GPSProvider.cpp	Tue Nov 04 11:31:49 2014 +0000
+++ b/GPSProvider.cpp	Fri Nov 07 08:24:48 2014 +0000
@@ -89,3 +89,12 @@
 {
     impl->lpmGetImmediateLocation();
 }
+
+GPSProvider::~GPSProvider()
+{
+    if (impl) {
+        delete impl;
+    }
+
+    impl = NULL;
+}
--- a/GPSProvider.h	Tue Nov 04 11:31:49 2014 +0000
+++ b/GPSProvider.h	Fri Nov 07 08:24:48 2014 +0000
@@ -244,9 +244,7 @@
         /* empty */
     }
 
-    virtual ~GPSProvider() {
-        stop();
-    }
+    ~GPSProvider();
 
 private:
     /**
@@ -256,7 +254,7 @@
      * driver library. The mechanics of the implementation are to be hidden
      * behind the abstract interface provided by GPSProvider.
      */
-    GPSProviderImplBase *const impl;
+    GPSProviderImplBase *impl;
 
     /* disallow copy constructor and assignment operators */
 private:
--- a/GPSProviderImplBase.h	Tue Nov 04 11:31:49 2014 +0000
+++ b/GPSProviderImplBase.h	Fri Nov 07 08:24:48 2014 +0000
@@ -45,6 +45,15 @@
         locationCallback = callback;
     }
 
+public:
+    GPSProviderImplBase() : lastLocation(), deviceInfo(NULL), locationCallback(NULL) {
+        /* empty */
+    }
+
+    virtual ~GPSProviderImplBase() {
+        /* empty */
+    }
+
 protected:
     GPSProvider::LocationUpdateParams_t    lastLocation;
     const char                            *deviceInfo;