Skip to content
This repository has been archived by the owner on Mar 26, 2021. It is now read-only.

Commit

Permalink
IOMA-6234: copy patch from mapbox#8374 to prevent features crashes on…
Browse files Browse the repository at this point in the history
… stale tiles
  • Loading branch information
Romain Quidet committed Mar 15, 2017
1 parent d719991 commit a613b76
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/mbgl/geometry/feature_index.cpp
Expand Up @@ -157,5 +157,9 @@ void FeatureIndex::addBucketLayerName(const std::string& bucketName, const std::
void FeatureIndex::setCollisionTile(std::unique_ptr<CollisionTile> collisionTile_) {
collisionTile = std::move(collisionTile_);
}

void FeatureIndex::resetCollisionTile() {
collisionTile.reset();
}

} // namespace mbgl
1 change: 1 addition & 0 deletions src/mbgl/geometry/feature_index.hpp
Expand Up @@ -54,6 +54,7 @@ class FeatureIndex {
void addBucketLayerName(const std::string& bucketName, const std::string& layerName);

void setCollisionTile(std::unique_ptr<CollisionTile>);
void resetCollisionTile();

private:
void addFeature(
Expand Down
1 change: 1 addition & 0 deletions src/mbgl/tile/geometry_tile.cpp
Expand Up @@ -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);
}

Expand Down

0 comments on commit a613b76

Please sign in to comment.