From 48c17c80b9bb003ff92150d6ca8a54109b987715 Mon Sep 17 00:00:00 2001 From: Paolo Angelelli Date: Sat, 8 Apr 2017 00:02:42 +0200 Subject: 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 Reviewed-by: Alex Blasche --- src/location/declarativemaps/qquickgeomapgesturearea.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/location/declarativemaps/qquickgeomapgesturearea.cpp') 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 map) { if (m_map || !map) return; -- cgit v1.2.3