Skip to content
This repository has been archived by the owner on Aug 8, 2023. It is now read-only.

[core] Reset observers of removed Sources and Layers #8900

Merged
merged 1 commit into from
May 5, 2017

Conversation

jfirebaugh
Copy link
Contributor

This ensures that the observer is not an invalid reference if the removed Source/Layer is retained, but the Style is deallocated.

This would have caused memory corruption in the following sequence:

  1. Remove a source/layer from the style, retaining a reference
  2. Change the style URL
  3. Mutate the source/layer via the retained reference (e.g. GeoJSONSource::setURL, Layer::setFilter, or any other setter)

This ensures that the observer is not an invalid reference if the removed Source/Layer is retained, but the Style is deallocated.
@jfirebaugh jfirebaugh merged commit dd353a6 into master May 5, 2017
@jfirebaugh jfirebaugh deleted the reset-observer-on-remove branch May 5, 2017 16:23
@tobrun tobrun mentioned this pull request Jun 9, 2017
12 tasks
@tobrun tobrun mentioned this pull request Jun 21, 2017
11 tasks
@tobrun tobrun mentioned this pull request Jun 30, 2017
16 tasks
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants