-
Notifications
You must be signed in to change notification settings - Fork 1.3k
MGLSource should not maintain parallel state #7375
Comments
This is essentially blocked by #7376, because otherwise we can continue to expose an |
#7377 will eliminate |
I updated the example in the original description above: |
This gets into #7376 and the memory concerns noted there but would it make sense for |
It's definitely possible and it'd solve several problems associated with these wrappers. We already do that for MGLOpenGLStyleLayers, which are entirely managed by the style. I wanted to avoid doing that for sources and layers in general, since there may be ways for the style to change behind MGLStyle's back, whereas a custom layer can only come from application code. |
I'm open to adding a |
The more I think about this, the more attractive @boundsj’s idea in #7375 (comment) looks. The only catch is that we have to be absolutely certain MGLStyle knows exactly when a source or layer goes away, such as due to polyline/polygon annotation removals. A |
What does ARC do if you use a type-erasure-based |
Type erasure via /ref #13492 |
This issue has been automatically detected as stale because it has not had recent activity and will be archived. Thank you for your contributions. |
Still the biggest pain point with runtime styling in Objective-C and Swift. |
This might not be a problem anymore if ARC can track ownership of Objective-C objects within C/C++ structs. The only unknown, then, is whether that also extends to |
This issue has been automatically detected as stale because it has not had recent activity and will be archived. Thank you for your contributions. |
MGLSource and its subclasses, particularly MGLShapeSource, currently hang onto objects passed into their initializers in order to return them in their properties’ getters. This is a workaround for #6584, but it’s problematic because MGLSource objects don’t necessarily know the canonical value of these properties. For example, if you get a source via
-[MGLStyle sourceWithIdentifier:]
, the properties are all unset because the source was initialized via-[MGLSource initWithRawSource:]
. You can then proceed to modify the source’s contents behind the backs of any other MGLShapeSource instances that wrap that source:/cc @boundsj
The text was updated successfully, but these errors were encountered: