fix appendChildNode() call
authorDebian Qt/KDE Maintainers <debian-qt-kde@lists.debian.org>
Sat, 23 Sep 2023 19:58:22 +0000 (20:58 +0100)
committerDmitry Shachnev <mitya57@debian.org>
Sat, 23 Sep 2023 19:58:22 +0000 (20:58 +0100)
Origin: upstream, https://code.qt.io/cgit/qt/qtlocation.git/commit/?id=6cb20a08b65c73b4
Last-Update: 2023-08-18

The QSGNode::appendChildNode() method checks that its parameter must
not have a parent. Before this patch we always called appendChildNode()
on a node that already had parent, which was always leading to ASSERT
in a debug build.

Seems that the right approach would be to call this method, if the
node *does not* have a parent.

Gbp-Pq: Name fix_appendChildNode_call.diff

src/location/labs/qsg/qgeomapobjectqsgsupport.cpp

index a978573d61928d25c23d3afb7c02db38546a82d3..11e1466f41848c0596ee5360ee875267b13b1477 100644 (file)
@@ -158,7 +158,7 @@ void QGeoMapObjectQSGSupport::updateMapObjects(QSGNode *root, QQuickWindow *wind
     if (!root)
         return;
 
-    if (m_mapObjectsRootNode && m_mapObjectsRootNode->parent())
+    if (m_mapObjectsRootNode && !m_mapObjectsRootNode->parent())
         root->appendChildNode(m_mapObjectsRootNode.get());
 
     if (!m_mapObjectsRootNode) {