diff --git a/src/mbgl/geometry/feature_index.cpp b/src/mbgl/geometry/feature_index.cpp index b37bdb5ecc0..1d111735a8c 100644 --- a/src/mbgl/geometry/feature_index.cpp +++ b/src/mbgl/geometry/feature_index.cpp @@ -157,5 +157,9 @@ void FeatureIndex::addBucketLayerName(const std::string& bucketName, const std:: void FeatureIndex::setCollisionTile(std::unique_ptr collisionTile_) { collisionTile = std::move(collisionTile_); } + +void FeatureIndex::resetCollisionTile() { + collisionTile.reset(); +} } // namespace mbgl diff --git a/src/mbgl/geometry/feature_index.hpp b/src/mbgl/geometry/feature_index.hpp index 021770c78d3..76b8b3e4117 100644 --- a/src/mbgl/geometry/feature_index.hpp +++ b/src/mbgl/geometry/feature_index.hpp @@ -54,6 +54,7 @@ class FeatureIndex { void addBucketLayerName(const std::string& bucketName, const std::string& layerName); void setCollisionTile(std::unique_ptr); + void resetCollisionTile(); private: void addFeature( diff --git a/src/mbgl/tile/geometry_tile.cpp b/src/mbgl/tile/geometry_tile.cpp index 84455e47877..6375be18565 100644 --- a/src/mbgl/tile/geometry_tile.cpp +++ b/src/mbgl/tile/geometry_tile.cpp @@ -102,6 +102,7 @@ void GeometryTile::onLayout(LayoutResult result) { buckets = std::move(result.buckets); featureIndex = std::move(result.featureIndex); data = std::move(result.tileData); + featureIndex->resetCollisionTile(); observer->onTileChanged(*this); }