diff options
author | Tobrun <tobrun.van.nuland@gmail.com> | 2018-12-05 16:53:52 +0200 |
---|---|---|
committer | Tobrun <tobrun@mapbox.com> | 2018-12-10 16:59:50 +0100 |
commit | acbe2475f91127cda76ff0857d36ab3c29e58257 (patch) | |
tree | 71feac0c8f55b15d1bc4120ecb8d6e7efafe69e6 | |
parent | 3ffb62b41956fd14fe9ed7d0f7779be9c0ec8325 (diff) | |
download | qtlocation-mapboxgl-acbe2475f91127cda76ff0857d36ab3c29e58257.tar.gz |
[android] - cleanup images
-rw-r--r-- | platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/maps/Style.java | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/maps/Style.java b/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/maps/Style.java index cb60f2dbea..ac9a6936b8 100644 --- a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/maps/Style.java +++ b/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/maps/Style.java @@ -16,6 +16,7 @@ import java.lang.annotation.RetentionPolicy; import java.util.ArrayList; import java.util.HashMap; import java.util.List; +import java.util.Map; /** * The proxy object for current map style. @@ -30,6 +31,7 @@ public class Style implements NativeMapView.StyleCallback { private final NativeMapView nativeMapView; private final HashMap<String, Source> sources = new HashMap<>(); private final HashMap<String, Layer> layers = new HashMap<>(); + private final HashMap<String, Bitmap> images = new HashMap<>(); private final OnStyleLoaded onStyleLoaded; private final Builder builder; private boolean styleLoaded; @@ -381,8 +383,14 @@ public class Style implements NativeMapView.StyleCallback { } } + for (Map.Entry<String, Bitmap> bitmapEntry : images.entrySet()) { + nativeMapView.removeImage(bitmapEntry.getKey()); + bitmapEntry.getValue().recycle(); + } + sources.clear(); layers.clear(); + images.clear(); } /** |