summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJulian Rex <julian.rex@mapbox.com>2018-02-28 16:41:16 -0500
committerJulian Rex <julian.rex@mapbox.com>2018-02-28 16:41:16 -0500
commit6c9239c8746d9d3f0e3bdb340838978b7b998eba (patch)
treecc7a98764b0ecad10af1974c3683e44f480c5166
parent0327167738336404ac02c2d0202b1de860dd060e (diff)
downloadqtlocation-mapboxgl-6c9239c8746d9d3f0e3bdb340838978b7b998eba.tar.gz
[macos] Added retain/release calls to macos's MGLMapView cf. iOS.
-rw-r--r--platform/ios/src/MGLMapView.mm1
-rw-r--r--platform/macos/src/MGLMapView.mm4
2 files changed, 4 insertions, 1 deletions
diff --git a/platform/ios/src/MGLMapView.mm b/platform/ios/src/MGLMapView.mm
index 2df7de2c5c..92ee50ce3d 100644
--- a/platform/ios/src/MGLMapView.mm
+++ b/platform/ios/src/MGLMapView.mm
@@ -361,7 +361,6 @@ public:
styleURL = styleURL.mgl_URLByStandardizingScheme;
-// [self.layers removeAllObjects];
self.style = nil;
_mbglMap->getStyle().loadURL([[styleURL absoluteString] UTF8String]);
diff --git a/platform/macos/src/MGLMapView.mm b/platform/macos/src/MGLMapView.mm
index 9ec9012198..e54b0f195d 100644
--- a/platform/macos/src/MGLMapView.mm
+++ b/platform/macos/src/MGLMapView.mm
@@ -882,6 +882,8 @@ public:
return;
}
+ [self.style retainLayersUsedDuringRendering];
+
if ([self.delegate respondsToSelector:@selector(mapViewWillStartRenderingFrame:)]) {
[self.delegate mapViewWillStartRenderingFrame:self];
}
@@ -899,6 +901,8 @@ public:
if ([self.delegate respondsToSelector:@selector(mapViewDidFinishRenderingFrame:fullyRendered:)]) {
[self.delegate mapViewDidFinishRenderingFrame:self fullyRendered:fullyRendered];
}
+
+ [self.style releaseLayersUsedDuringRendering];
}
- (void)mapViewWillStartRenderingMap {