summaryrefslogtreecommitdiff
path: root/src/location/labs/qsg/qgeomapobjectqsgsupport_p.h
diff options
context:
space:
mode:
authorPiotr Mikolajczyk <piotr.mikolajczyk@qt.io>2020-11-03 11:43:22 +0100
committerAndy Shaw <andy.shaw@qt.io>2020-11-09 09:41:49 +0000
commit861e372b6ad81570d4f496e42fb25a6699b72f2f (patch)
treed9567059148c61eab18e4069caed1d3445145606 /src/location/labs/qsg/qgeomapobjectqsgsupport_p.h
parentf7a270142eef06eb493a2f6b544c4ea66c9d5c23 (diff)
downloadqtlocation-861e372b6ad81570d4f496e42fb25a6699b72f2f.tar.gz
Simpler fix to crashing Qml Map appearing 2nd+ time
Previous solution did not take advantage of the QSGNode::OwnedByParent flag. Setting this flag to false allows to use parent() property to determine if the node has been removed from node tree. This amends 4fe9e0ed027134a833b2243597a2ccd00987b559 Fixes: QTBUG-85260 Change-Id: I705848483d7dc2639dffffa0ff66c682b3fffca0 Reviewed-by: Andy Shaw <andy.shaw@qt.io>
Diffstat (limited to 'src/location/labs/qsg/qgeomapobjectqsgsupport_p.h')
-rw-r--r--src/location/labs/qsg/qgeomapobjectqsgsupport_p.h3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/location/labs/qsg/qgeomapobjectqsgsupport_p.h b/src/location/labs/qsg/qgeomapobjectqsgsupport_p.h
index 1ec966fa..cbbc0969 100644
--- a/src/location/labs/qsg/qgeomapobjectqsgsupport_p.h
+++ b/src/location/labs/qsg/qgeomapobjectqsgsupport_p.h
@@ -59,6 +59,7 @@
#include <QtLocation/private/qdeclarativepolylinemapitem_p.h>
#include <QtLocation/private/qdeclarativepolygonmapitem_p_p.h>
#include <QtCore/qpointer.h>
+#include <memory>
QT_BEGIN_NAMESPACE
struct Q_LOCATION_PRIVATE_EXPORT MapObject {
@@ -85,7 +86,7 @@ public:
QList<MapObject> m_pendingMapObjects;
QList<MapObject> m_removedMapObjects;
QGeoMap *m_map = nullptr;
- QDeclarativePolygonMapItemPrivateOpenGL::RootNode *m_mapObjectsRootNode = nullptr;
+ std::unique_ptr<QDeclarativePolygonMapItemPrivateOpenGL::RootNode> m_mapObjectsRootNode;
};
QT_END_NAMESPACE