summaryrefslogtreecommitdiff
path: root/src/mbgl/tile/geometry_tile.cpp
diff options
context:
space:
mode:
authorChris Loer <chris.loer@gmail.com>2018-01-17 14:26:36 -0800
committerChris Loer <chris.loer@mapbox.com>2018-01-18 14:36:22 -0800
commit656a6373b91ad0c757fdeb8fb1ffb80e9f53d649 (patch)
treeca3837fc9e51ec522b54f89af2b4e954aeb17de0 /src/mbgl/tile/geometry_tile.cpp
parent42845ad63fc2147426b6379ed4acd51d3328a0e4 (diff)
downloadqtlocation-mapboxgl-656a6373b91ad0c757fdeb8fb1ffb80e9f53d649.tar.gz
[core] Synchronize state of CollisionIndex and FeatureIndexes.
Fixes issue #10778, in which mismatch between FeatureIndex and CollisionIndex could lead to inconsistent results or even invalid array access.
Diffstat (limited to 'src/mbgl/tile/geometry_tile.cpp')
-rw-r--r--src/mbgl/tile/geometry_tile.cpp8
1 files changed, 7 insertions, 1 deletions
diff --git a/src/mbgl/tile/geometry_tile.cpp b/src/mbgl/tile/geometry_tile.cpp
index 7d93b61c5b..4965158a9f 100644
--- a/src/mbgl/tile/geometry_tile.cpp
+++ b/src/mbgl/tile/geometry_tile.cpp
@@ -130,7 +130,7 @@ void GeometryTile::onLayout(LayoutResult result, const uint64_t resultCorrelatio
// replacing a tile at a different zoom that _did_ have symbols.
(void)resultCorrelationID;
nonSymbolBuckets = std::move(result.nonSymbolBuckets);
- featureIndex = std::move(result.featureIndex);
+ pendingFeatureIndex = std::move(result.featureIndex);
data = std::move(result.tileData);
observer->onTileChanged(*this);
}
@@ -213,6 +213,12 @@ Bucket* GeometryTile::getBucket(const Layer::Impl& layer) const {
return it->second.get();
}
+void GeometryTile::commitFeatureIndex() {
+ if (pendingFeatureIndex) {
+ featureIndex = std::move(pendingFeatureIndex);
+ }
+}
+
void GeometryTile::queryRenderedFeatures(
std::unordered_map<std::string, std::vector<Feature>>& result,
const GeometryCoordinates& queryGeometry,