summaryrefslogtreecommitdiff
path: root/src/mbgl/tile/geometry_tile.hpp
diff options
context:
space:
mode:
authorChris Loer <chris.loer@gmail.com>2018-03-28 15:40:57 -0700
committerChris Loer <chris.loer@mapbox.com>2018-03-29 09:04:23 -0700
commite5a3a7a4510bbbf2fc97363ab0084fb4bc3dd448 (patch)
tree9e8c81aa79cc1214b89a0485147645053641a7c1 /src/mbgl/tile/geometry_tile.hpp
parentf9b6d5f09c844ad367c54d34677d71c9da757bba (diff)
downloadqtlocation-mapboxgl-e5a3a7a4510bbbf2fc97363ab0084fb4bc3dd448.tar.gz
[core] Fix potential race condition crash in symbol querying..
Second half of fix for issue #11538. If a global placement took place between the time a tile's non-symbol layout updated and the time new symbol buckets arrived, the tile's new FeatureIndex would be committed, but the global CollisionIndex would be generated against the old symbolBuckets. The mismatch could cause the CollisionIndex to contain indices that didn't exist in the new FeatureIndex, and attempting to access them would generate an out-of-bounds exception.
Diffstat (limited to 'src/mbgl/tile/geometry_tile.hpp')
-rw-r--r--src/mbgl/tile/geometry_tile.hpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/mbgl/tile/geometry_tile.hpp b/src/mbgl/tile/geometry_tile.hpp
index 0c6adf0337..8843d6e579 100644
--- a/src/mbgl/tile/geometry_tile.hpp
+++ b/src/mbgl/tile/geometry_tile.hpp
@@ -125,9 +125,9 @@ private:
std::unordered_map<std::string, std::shared_ptr<Bucket>> nonSymbolBuckets;
std::unique_ptr<FeatureIndex> featureIndex;
- optional<std::unique_ptr<FeatureIndex>> pendingFeatureIndex;
+ optional<std::pair<bool,std::unique_ptr<FeatureIndex>>> pendingFeatureIndex;
std::unique_ptr<const GeometryTileData> data;
- optional<std::unique_ptr<const GeometryTileData>> pendingData;
+ optional<std::pair<bool, std::unique_ptr<const GeometryTileData>>> pendingData;
optional<AlphaImage> glyphAtlasImage;
optional<PremultipliedImage> iconAtlasImage;