summaryrefslogtreecommitdiff
path: root/platform/android
diff options
context:
space:
mode:
authorRobin Darby <robin.darby@mapquest.com>2017-08-28 15:02:44 -0600
committerTobrun <tobrun@mapbox.com>2017-09-26 11:43:33 +0200
commit6dbdf3aaeb8b1a18e989bc4e7672cb2d801b2426 (patch)
tree8789eea9cbfefb7873f7373f1f82b79258d00a02 /platform/android
parent95092df8e96514d59c777b6becd953ff1b187790 (diff)
downloadqtlocation-mapboxgl-6dbdf3aaeb8b1a18e989bc4e7672cb2d801b2426.tar.gz
[android] Clear out mapCallback's OnMapReadyCallbacks on onDestroy
Diffstat (limited to 'platform/android')
-rw-r--r--platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/maps/MapView.java5
1 files changed, 5 insertions, 0 deletions
diff --git a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/maps/MapView.java b/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/maps/MapView.java
index 32c4952aa1..91c77c3e33 100644
--- a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/maps/MapView.java
+++ b/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/maps/MapView.java
@@ -264,6 +264,7 @@ public class MapView extends FrameLayout {
nativeMapView.terminateContext();
nativeMapView.terminateDisplay();
nativeMapView.destroySurface();
+ mapCallback.clearOnMapReadyCallbacks();
nativeMapView.destroy();
nativeMapView = null;
}
@@ -955,5 +956,9 @@ public class MapView extends FrameLayout {
void addOnMapReadyCallback(OnMapReadyCallback callback) {
onMapReadyCallbackList.add(callback);
}
+
+ void clearOnMapReadyCallbacks() {
+ onMapReadyCallbackList.clear();
+ }
}
}