Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Revision 4:f35227b1f341, committed 2014-11-07
- 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
--- 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;