summaryrefslogtreecommitdiff
path: root/src/location/labs/qsg/qmappolylineobjectqsg.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/location/labs/qsg/qmappolylineobjectqsg.cpp')
-rw-r--r--src/location/labs/qsg/qmappolylineobjectqsg.cpp11
1 files changed, 6 insertions, 5 deletions
diff --git a/src/location/labs/qsg/qmappolylineobjectqsg.cpp b/src/location/labs/qsg/qmappolylineobjectqsg.cpp
index 2bf5b287..96f66565 100644
--- a/src/location/labs/qsg/qmappolylineobjectqsg.cpp
+++ b/src/location/labs/qsg/qmappolylineobjectqsg.cpp
@@ -107,25 +107,26 @@ QSGNode *QMapPolylineObjectPrivateQSG::updateMapObjectNode(QSGNode *oldNode,
Q_UNUSED(visibleNode);
MapPolylineNode *node = static_cast<MapPolylineNode *>(oldNode);
- bool created = false;
if (!node) {
if (!m_geometry.size()) // condition to block the subtree
return nullptr;
node = new MapPolylineNode();
*visibleNode = static_cast<VisibleNode *>(node);
- created = true;
}
//TODO: update only material
- if (m_geometry.isScreenDirty() || !oldNode || created) {
+ if (m_geometry.isScreenDirty() || !oldNode) {
node->update(color(), &m_geometry);
m_geometry.setPreserveGeometry(false);
m_geometry.markClean();
}
- if (created)
+ if (m_geometry.size()) {
root->appendChildNode(node);
-
+ } else {
+ delete node;
+ return nullptr;
+ }
return node;
}