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

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

Merged
jfirebaugh merged 1 commit into
masterfrom
reset-observer-on-remove
May 5, 2017
Merged

[core] Reset observers of removed Sources and Layers#8900
jfirebaugh merged 1 commit into
masterfrom
reset-observer-on-remove

Conversation

@jfirebaugh
Copy link
Copy Markdown
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 force-pushed the reset-observer-on-remove branch from 088ed36 to 413c5eb Compare May 4, 2017 22:45
@jfirebaugh jfirebaugh requested review from boundsj and kkaefer May 4, 2017 23:35
@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.

2 participants