diff --git a/platform/ios/src/MLNMapView+Metal.mm b/platform/ios/src/MLNMapView+Metal.mm index d8614c920b3..c9635b6df00 100644 --- a/platform/ios/src/MLNMapView+Metal.mm +++ b/platform/ios/src/MLNMapView+Metal.mm @@ -54,8 +54,6 @@ void bind() override { commandBuffer = [commandQueue commandBuffer]; commandBufferPtr = NS::RetainPtr((__bridge MTL::CommandBuffer*)commandBuffer); - - currentDrawable = [mtlView currentDrawable]; } const mbgl::mtl::RendererBackend& getBackend() const override { return backend; } @@ -78,6 +76,7 @@ void bind() override { } void swap() override { + id currentDrawable = [mtlView currentDrawable]; [commandBuffer presentDrawable:currentDrawable]; [commandBuffer commit]; @@ -105,7 +104,6 @@ void swap() override { public: MLNMapViewImplDelegate* delegate = nil; MTKView *mtlView = nil; - id currentDrawable; id commandBuffer; id commandQueue;