summaryrefslogtreecommitdiff
path: root/src/location/maps/qgeomappingmanager.h
diff options
context:
space:
mode:
authorAlex Wilson <alex.wilson@nokia.com>2012-03-06 14:00:36 +1000
committerQt by Nokia <qt-info@nokia.com>2012-03-09 02:16:47 +0100
commit4c329881707317674e5672862f16e8143676c265 (patch)
tree0dc774424a987b01baad2969e41dcd3385055eda /src/location/maps/qgeomappingmanager.h
parentbb78475bef0ea9f5cb7e3cb70826e5361320f060 (diff)
downloadqtlocation-4c329881707317674e5672862f16e8143676c265.tar.gz
Implementing deregisterMap to avoid crashes on slow requests
Previously, high-latency requests that were still running could complete after deregisterMap() was called, and a pointer to the old QGeoMap would still be present in the array -- which triggered a segfault. Now we make sure to remove all references to a disappearing map. This patch also handles a common destructor race causing similar segfaults at exit (and in autotests) Change-Id: I936d6c0d556d79fc43aa238b0b1d3dc63e5db11e Reviewed-by: Aaron McCarthy <aaron.mccarthy@nokia.com>
Diffstat (limited to 'src/location/maps/qgeomappingmanager.h')
-rw-r--r--src/location/maps/qgeomappingmanager.h3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/location/maps/qgeomappingmanager.h b/src/location/maps/qgeomappingmanager.h
index fe6f74b3..aa877985 100644
--- a/src/location/maps/qgeomappingmanager.h
+++ b/src/location/maps/qgeomappingmanager.h
@@ -45,6 +45,7 @@
#include <QObject>
#include <QSize>
#include <QPair>
+#include <QSharedPointer>
#include <QtLocation/qlocationglobal.h>
#include "qgeomaptype.h"
@@ -113,7 +114,7 @@ Q_SIGNALS:
private:
QGeoMappingManager(QGeoMappingManagerEngine *engine, QObject *parent = 0);
- QGeoMappingManagerPrivate* d_ptr;
+ QSharedPointer<QGeoMappingManagerPrivate> d_ptr;
Q_DISABLE_COPY(QGeoMappingManager)
friend class QGeoServiceProvider;