[android] - clear map change listeners when map is destroyed

This commit is contained in:
Tobrun
2018-04-24 14:01:48 +02:00
committed by Tobrun
parent 5380d80c88
commit 5653b340bc
2 changed files with 4 additions and 2 deletions

View File

@@ -410,6 +410,7 @@ public class MapView extends FrameLayout implements NativeMapView.ViewCallback {
@UiThread
public void onDestroy() {
destroyed = true;
onMapChangedListeners.clear();
mapCallback.clearOnMapReadyCallbacks();
if (nativeMapView != null && hasSurface) {

View File

@@ -100,9 +100,10 @@ final class NativeMapView {
}
public void destroy() {
nativeDestroy();
viewCallback = null;
destroyed = true;
onMapChangedListeners.clear();
viewCallback = null;
nativeDestroy();
}
public void update() {