summaryrefslogtreecommitdiff
path: root/platform/darwin/src/MGLSource_Private.h
diff options
context:
space:
mode:
Diffstat (limited to 'platform/darwin/src/MGLSource_Private.h')
-rw-r--r--platform/darwin/src/MGLSource_Private.h8
1 files changed, 8 insertions, 0 deletions
diff --git a/platform/darwin/src/MGLSource_Private.h b/platform/darwin/src/MGLSource_Private.h
index 2fc170b86b..6f86e4800b 100644
--- a/platform/darwin/src/MGLSource_Private.h
+++ b/platform/darwin/src/MGLSource_Private.h
@@ -10,6 +10,14 @@ namespace mbgl {
}
}
+// A struct to be stored in the `peer` member of mbgl::style::Source, in order to implement
+// object identity. We don't store a MGLSource pointer directly because that doesn't
+// interoperate with ARC. The inner pointer is weak in order to avoid a reference cycle for
+// "pending" MGLSources, which have a strong owning pointer to the mbgl::style::Source.
+struct SourceWrapper {
+ __weak MGLSource *source;
+};
+
@class MGLMapView;
@interface MGLSource (Private)