summaryrefslogtreecommitdiff
path: root/platform/darwin/src/MGLStyleLayer_Private.h
diff options
context:
space:
mode:
Diffstat (limited to 'platform/darwin/src/MGLStyleLayer_Private.h')
-rw-r--r--platform/darwin/src/MGLStyleLayer_Private.h8
1 files changed, 8 insertions, 0 deletions
diff --git a/platform/darwin/src/MGLStyleLayer_Private.h b/platform/darwin/src/MGLStyleLayer_Private.h
index d024a0bb13..ed8ec31755 100644
--- a/platform/darwin/src/MGLStyleLayer_Private.h
+++ b/platform/darwin/src/MGLStyleLayer_Private.h
@@ -7,6 +7,14 @@
NS_ASSUME_NONNULL_BEGIN
+// A struct to be stored in the `peer` member of mbgl::style::Layer, in order to implement
+// object identity. We don't store a MGLStyleLayer pointer directly because that doesn't
+// interoperate with ARC. The inner pointer is weak in order to avoid a reference cycle for
+// "pending" MGLStyleLayers, which have a strong owning pointer to the mbgl::style::Layer.
+struct LayerWrapper {
+ __weak MGLStyleLayer *layer;
+};
+
/**
Assert that the style layer is valid.