From c0492dc14f615cf5e4748f3f6be237be8c82f8eb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thomas=20Kr=C3=B6niger?= <30893720+thirteenthstep@users.noreply.github.com> Date: Sat, 24 Oct 2020 13:23:06 +0200 Subject: [PATCH] fix memory leak caused by strong self reference (#370) --- ios/Classes/MapboxMapController.swift | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ios/Classes/MapboxMapController.swift b/ios/Classes/MapboxMapController.swift index 2ffce4b4a..4a5aa8e13 100644 --- a/ios/Classes/MapboxMapController.swift +++ b/ios/Classes/MapboxMapController.swift @@ -39,7 +39,7 @@ class MapboxMapController: NSObject, FlutterPlatformView, MGLMapViewDelegate, Ma super.init() channel = FlutterMethodChannel(name: "plugins.flutter.io/mapbox_maps_\(viewId)", binaryMessenger: registrar.messenger()) - channel!.setMethodCallHandler(onMethodCall) + channel!.setMethodCallHandler{ [weak self] in self?.onMethodCall(methodCall: $0, result: $1) } mapView.delegate = self