diff options
author | Chris Loer <chris.loer@gmail.com> | 2018-01-19 11:38:31 -0800 |
---|---|---|
committer | Chris Loer <chris.loer@mapbox.com> | 2018-01-19 14:50:42 -0800 |
commit | b2e71abfeeaf7326b47e54a0a255a3fe73628022 (patch) | |
tree | 6ba639c20443d7d8b757c3f79ad9e9b9313f7439 /src/mbgl/renderer | |
parent | 7c2e8c5eb1cda536be73e97afbc4b5276735fb51 (diff) | |
download | qtlocation-mapboxgl-b2e71abfeeaf7326b47e54a0a255a3fe73628022.tar.gz |
Prune unused layers from CrossTileSymbolIndex
Fixes issue #10939 -- removed layers would leak entries in the CrossTileSymbolIndex.
Diffstat (limited to 'src/mbgl/renderer')
-rw-r--r-- | src/mbgl/renderer/renderer_impl.cpp | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/src/mbgl/renderer/renderer_impl.cpp b/src/mbgl/renderer/renderer_impl.cpp index 8e5968d4c2..c38f1d56cb 100644 --- a/src/mbgl/renderer/renderer_impl.cpp +++ b/src/mbgl/renderer/renderer_impl.cpp @@ -382,8 +382,10 @@ void Renderer::Impl::render(const UpdateParameters& updateParameters) { bool placementChanged = false; if (!placement->stillRecent(parameters.timePoint)) { auto newPlacement = std::make_unique<Placement>(parameters.state, parameters.mapMode); + std::set<std::string> usedSymbolLayers; for (auto it = order.rbegin(); it != order.rend(); ++it) { if (it->layer.is<RenderSymbolLayer>()) { + usedSymbolLayers.insert(it->layer.getID()); newPlacement->placeLayer(*it->layer.as<RenderSymbolLayer>(), parameters.projMatrix, parameters.debugOptions & MapDebugOptions::Collision); } } @@ -393,6 +395,7 @@ void Renderer::Impl::render(const UpdateParameters& updateParameters) { // started. If we violate this assumption, then we need to either make CollisionIndex completely independendent of // FeatureIndex, or find a way for its entries to point to multiple FeatureIndexes. commitFeatureIndexes(); + crossTileSymbolIndex.pruneUnusedLayers(usedSymbolLayers); if (placementChanged || symbolBucketsChanged) { placement = std::move(newPlacement); } |