-
Notifications
You must be signed in to change notification settings - Fork 1.3k
[not ready] fixes #1267: properly break reference cycle with tile data & style #1280
Conversation
I'm skeptical that this actually fixes the issue. The destructor will already do the equivalent of |
Yep, still looking at this with the stuff from caching #1255 piled atop to make sure. I think you're right. |
You are right that we don't need a |
5dab378
to
d29534e
Compare
The destructor does get called, but it's too late to let go of the style. We did have a |
I still don't quite understand why this is the case, even though I've outlined it above. Are objects unable to release references to shared pointers when the released objects follow a shared pointer reference chain back to themselves? |
Got it, finally. You are right @jfirebaugh that the problem is the When Here you can see the dummy, then the real, style being created, then the dummy destroyed ( When annotation support was introduced with the bug of not releasing Here you see the dummy style pre-async load, and the real post-parse real style, created each time, but no real styles nor layers/buckets/sources/tiles ever destroyed. This is good to go and I'm satisfied that I know why. Going to merge and get back to #1255. |
[not ready] fixes #1267: properly break reference cycle with tile data & style
@incanus and @jfirebaugh, can this cyclic reference explain why one might get "App terminated due to memory pressure" in xcode. I see this couple of times everyday. I do not have any live tiles/annotations explicitly added to the map. Its just plain zoom in/zoom out/pan operations on the map. |
@mb12 My guess is that's an unrelated issue. |
It could have been related — annotation tiles ( @mb12 Are you up to date with this PR and still seeing it? |
My repo does not have this PR. I do not have any explicit annotation/livetiledata. Would this code still kick in? |
Yes, annotations are always used in a sense.
So even without any annotations, the annotation source is always present and |
@incanus Thanks a lot for the detailed clarification. |
@incanus Could that leak occur even if you only loaded a style once? My impression was you had to be doing repeated style loads for it to happen. |
Ah, good point @jfirebaugh. If the first style never goes away, over-retaining does not matter. |
No description provided.