summaryrefslogtreecommitdiff
path: root/src/location/declarativemaps/qquickgeomapgesturearea.cpp
diff options
context:
space:
mode:
authorPaolo Angelelli <paolo.angelelli@qt.io>2017-04-08 00:02:42 +0200
committerPaolo Angelelli <paolo.angelelli@qt.io>2017-04-11 15:38:54 +0000
commit48c17c80b9bb003ff92150d6ca8a54109b987715 (patch)
treedc2c15614d71c1c5f4a09bf088760df425b40b81 /src/location/declarativemaps/qquickgeomapgesturearea.cpp
parentde46e34ca67eba6191768338bb87781e65e6a1a1 (diff)
downloadqtlocation-48c17c80b9bb003ff92150d6ca8a54109b987715.tar.gz
Protect QGeoMap pointer with QPointer
m_map inside QDeclarativeGeoMap is created, but also destroyed, by the engine. In some cases (dynamic QML object creation/destruction) the engine may disappear before the Map. This patch introduces a QPointer to prevent a dangling pointer Change-Id: Ice3c57b4dbeb96ee8d7e4d401654b9085c105dec Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
Diffstat (limited to 'src/location/declarativemaps/qquickgeomapgesturearea.cpp')
-rw-r--r--src/location/declarativemaps/qquickgeomapgesturearea.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/location/declarativemaps/qquickgeomapgesturearea.cpp b/src/location/declarativemaps/qquickgeomapgesturearea.cpp
index 412e33a1..3511226c 100644
--- a/src/location/declarativemaps/qquickgeomapgesturearea.cpp
+++ b/src/location/declarativemaps/qquickgeomapgesturearea.cpp
@@ -506,7 +506,7 @@ QQuickGeoMapGestureArea::QQuickGeoMapGestureArea(QDeclarativeGeoMap *map)
/*!
\internal
*/
-void QQuickGeoMapGestureArea::setMap(QGeoMap *map)
+void QQuickGeoMapGestureArea::setMap(QPointer<QGeoMap> map)
{
if (m_map || !map)
return;