summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorPaolo Angelelli <paolo.angelelli@qt.io>2017-04-08 00:17:34 +0200
committerPaolo Angelelli <paolo.angelelli@qt.io>2017-04-11 15:39:29 +0000
commit07eeb77c793caaeb49ae29043f2ca4ee0c2cce7a (patch)
treef7a09472ba2999e9e18cc5db90db1be09ab99f3c /src
parentd1dab7bf15f905b356f85249bdc57a9aae9c931b (diff)
downloadqtlocation-07eeb77c793caaeb49ae29043f2ca4ee0c2cce7a.tar.gz
Prevent containers from detaching within for loops in QGeoTiledMapScene
Change-Id: I7f81f3dab3ef0243c45ec22bafa8687f756134f4 Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
Diffstat (limited to 'src')
-rw-r--r--src/location/maps/qgeotiledmapscene.cpp12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/location/maps/qgeotiledmapscene.cpp b/src/location/maps/qgeotiledmapscene.cpp
index d6e74990..7885290e 100644
--- a/src/location/maps/qgeotiledmapscene.cpp
+++ b/src/location/maps/qgeotiledmapscene.cpp
@@ -573,9 +573,9 @@ void QGeoTiledMapRootNode::updateTiles(QGeoTiledMapTileContainerNode *root,
cameraMatrix.lookAt(toVector3D(eye), toVector3D(center), toVector3D(d->m_cameraUp));
root->setMatrix(d->m_projectionMatrix * cameraMatrix);
- QSet<QGeoTileSpec> tilesInSG = QSet<QGeoTileSpec>::fromList(root->tiles.keys());
- QSet<QGeoTileSpec> toRemove = tilesInSG - d->m_visibleTiles;
- QSet<QGeoTileSpec> toAdd = d->m_visibleTiles - tilesInSG;
+ const QSet<QGeoTileSpec> tilesInSG = QSet<QGeoTileSpec>::fromList(root->tiles.keys());
+ const QSet<QGeoTileSpec> toRemove = tilesInSG - d->m_visibleTiles;
+ const QSet<QGeoTileSpec> toAdd = d->m_visibleTiles - tilesInSG;
for (const QGeoTileSpec &s : toRemove)
delete root->tiles.take(s);
@@ -690,9 +690,9 @@ QSGNode *QGeoTiledMapScene::updateSceneGraph(QSGNode *oldNode, QQuickWindow *win
d->m_updatedTextures.clear();
}
- QSet<QGeoTileSpec> textures = QSet<QGeoTileSpec>::fromList(mapRoot->textures.keys());
- QSet<QGeoTileSpec> toRemove = textures - d->m_visibleTiles;
- QSet<QGeoTileSpec> toAdd = d->m_visibleTiles - textures;
+ const QSet<QGeoTileSpec> textures = QSet<QGeoTileSpec>::fromList(mapRoot->textures.keys());
+ const QSet<QGeoTileSpec> toRemove = textures - d->m_visibleTiles;
+ const QSet<QGeoTileSpec> toAdd = d->m_visibleTiles - textures;
for (const QGeoTileSpec &spec : toRemove)
mapRoot->textures.take(spec)->deleteLater();