summaryrefslogtreecommitdiff
path: root/platform/darwin/src/MGLBackgroundStyleLayer.mm
diff options
context:
space:
mode:
Diffstat (limited to 'platform/darwin/src/MGLBackgroundStyleLayer.mm')
-rw-r--r--platform/darwin/src/MGLBackgroundStyleLayer.mm6
1 files changed, 3 insertions, 3 deletions
diff --git a/platform/darwin/src/MGLBackgroundStyleLayer.mm b/platform/darwin/src/MGLBackgroundStyleLayer.mm
index 166c5926f5..f6a6973363 100644
--- a/platform/darwin/src/MGLBackgroundStyleLayer.mm
+++ b/platform/darwin/src/MGLBackgroundStyleLayer.mm
@@ -62,13 +62,13 @@
- (void)removeFromMapView:(MGLMapView *)mapView
{
- _pendingLayer = nullptr;
- self.rawLayer = nullptr;
-
auto removedLayer = mapView.mbglMap->removeLayer(self.identifier.UTF8String);
if (!removedLayer) {
return;
}
+ auto originalLayer = std::make_unique<mbgl::style::BackgroundLayer>(self.identifier.UTF8String);
+ _pendingLayer = std::move(originalLayer);
+ self.rawLayer = _pendingLayer.get();
mbgl::style::BackgroundLayer *layer = dynamic_cast<mbgl::style::BackgroundLayer *>(removedLayer.get());
if (!layer) {