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

don't stop/start map in related to style changes anymore since safe - #1077

Merged
incanus merged 1 commit into
masterfrom
fix-style-change-crash
Mar 24, 2015
Merged

incanus merged 1 commit into
masterfrom
fix-style-change-crash

Conversation

@incanus

@incanus incanus commented Mar 24, 2015

Copy link
Copy Markdown
Contributor

This behaves like OS X, where the map is started once at init, and then only ever again after being stopped from app backgrounding. Nothing to do with styling, which can happen before or after start, from the main thread, without otherwise touching the map since it triggers its own updates.

@1ec5

1ec5 commented Mar 24, 2015

Copy link
Copy Markdown
Contributor

Sweet! This change seems to fix #788, #1014, and #1072.

@mb12

mb12 commented Mar 24, 2015

Copy link
Copy Markdown

How does this change prevent invalid access to SourceInfo objects from worker threads which have not yet finished?

1.) SourceInfo objects are created upon parsing style.json.
2.) TileData holds a reference to SourceInfo. <== This reference will become invalid when new style is loaded into the map.
3.) TileParser holds a reference to TileData.

When style.json is changed these SourceInfo objects would get deleted. ( They reside under Map.style.layers.layers.bucket.style_source.info ).
If any of the TileParser workers has not finished after Map.style has been changed, this would cause an invalid access.

@incanus

incanus commented Mar 24, 2015

Copy link
Copy Markdown
Contributor Author

How does this change prevent invalid access to SourceInfo objects from worker threads which have not yet finished?

That doesn't really fall to this PR specifically, but more to @kkaefer's new approach which enabled it:

ebd2985

I think the fact that it's titled "make style updates a little more threadsafe" is an indication that this is a moving target still 😄

incanus added a commit that referenced this pull request Mar 24, 2015
don't stop/start map in relation to style changes anymore since safe
@incanus
incanus merged commit fb41d0c into master Mar 24, 2015
@incanus
incanus deleted the fix-style-change-crash branch March 24, 2015 05:30
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants