Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Prune unused layers from the CrossTileSymbolIndex #6016

Merged
merged 1 commit into from
Jan 22, 2018
Merged

Conversation

ChrisLoer
Copy link
Contributor

Fixes issue #5995 (index leaked removed layers).

I don't think #5995 was a very big deal, but I just wanted to get this loose end out of the way. There are two changes here:

  1. If you add and remove many layers with unique IDs, you won't end up with left-behind cruft in the CrossTileSymbolIndex
  2. If you and and remove a layer with the same ID, you won't pick up the crossTileIDs from previously indexed versions of the layer. I don't think this change matters, because (a) crossTileIDs are always contained to one layer, and the entire layer was removed, so (b) there's no existing fade/collision state that's going to get copied over because you're using old IDs vs new IDs.

I added a basic unit test for the remove process and manually tested removing a layer from an active map and then adding it back.

/cc @ansis @mollymerp

Fixes issue #5995 (index leaked removed layers)
Copy link
Contributor

@ansis ansis left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

looks good!

Copy link
Contributor

@mollymerp mollymerp left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM! (but shouldn't it be layerIndices 😛 )

@ChrisLoer ChrisLoer merged commit decea3f into master Jan 22, 2018
@ChrisLoer ChrisLoer deleted the cloer-5995 branch January 22, 2018 21:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants