summaryrefslogtreecommitdiff
path: root/platform/darwin/src/MGLOpenGLStyleLayer.mm
diff options
context:
space:
mode:
authorAndrew Kitchen <andrew.kitchen@mapbox.com>2018-01-05 15:22:15 -0800
committerAndrew Kitchen <akitchen@gmail.com>2018-01-19 20:28:57 -0500
commitd0193c5b2b7140f54d6f166fa4e8a711a045915e (patch)
tree8f07e70edd959793785de3b572bf8a7f7851c655 /platform/darwin/src/MGLOpenGLStyleLayer.mm
parent2c48871c065c6efec42c5660c9560ecdfaa8d359 (diff)
downloadqtlocation-mapboxgl-d0193c5b2b7140f54d6f166fa4e8a711a045915e.tar.gz
Restores fix to MGLOpenGLStyleLayer memory-related crash (#10765)
Revert this commit to see integration test fail.
Diffstat (limited to 'platform/darwin/src/MGLOpenGLStyleLayer.mm')
-rw-r--r--platform/darwin/src/MGLOpenGLStyleLayer.mm9
1 files changed, 2 insertions, 7 deletions
diff --git a/platform/darwin/src/MGLOpenGLStyleLayer.mm b/platform/darwin/src/MGLOpenGLStyleLayer.mm
index 2bc76c9912..8933a77382 100644
--- a/platform/darwin/src/MGLOpenGLStyleLayer.mm
+++ b/platform/darwin/src/MGLOpenGLStyleLayer.mm
@@ -47,8 +47,7 @@ void MGLDrawCustomStyleLayer(void *context, const mbgl::style::CustomLayerRender
when creating an OpenGL style layer.
*/
void MGLFinishCustomStyleLayer(void *context) {
- //TODO: AK: revert once failing test established
- MGLOpenGLStyleLayer *layer = (__bridge MGLOpenGLStyleLayer *)context;
+ MGLOpenGLStyleLayer *layer = (__bridge_transfer MGLOpenGLStyleLayer *)context;
[layer willMoveFromMapView:layer.style.mapView];
}
@@ -102,8 +101,7 @@ void MGLFinishCustomStyleLayer(void *context) {
MGLPrepareCustomStyleLayer,
MGLDrawCustomStyleLayer,
MGLFinishCustomStyleLayer,
- //TODO: AK: revert once failing test established
- (__bridge void *)self);
+ (__bridge_retained void *)self);
return self = [super initWithPendingLayer:std::move(layer)];
}
@@ -118,10 +116,7 @@ void MGLFinishCustomStyleLayer(void *context) {
[NSException raise:@"MGLLayerReuseException"
format:@"%@ cannot be added to more than one MGLStyle at a time.", self];
}
- //TODO: AK: remove once failing test established
- _style.openGLLayers[self.identifier] = nil;
_style = style;
- _style.openGLLayers[self.identifier] = self;
}
- (void)addToStyle:(MGLStyle *)style belowLayer:(MGLStyleLayer *)otherLayer {