[android] remove layers first when clearing the style
This commit is contained in:
committed by
Łukasz Paczos
parent
e582a329ef
commit
dabf5d0c3a
@@ -518,13 +518,6 @@ public class Style {
|
||||
*/
|
||||
void clear() {
|
||||
fullyLoaded = false;
|
||||
for (Source source : sources.values()) {
|
||||
if (source != null) {
|
||||
source.setDetached();
|
||||
nativeMap.removeSource(source);
|
||||
}
|
||||
}
|
||||
|
||||
for (Layer layer : layers.values()) {
|
||||
if (layer != null) {
|
||||
layer.setDetached();
|
||||
@@ -532,6 +525,13 @@ public class Style {
|
||||
}
|
||||
}
|
||||
|
||||
for (Source source : sources.values()) {
|
||||
if (source != null) {
|
||||
source.setDetached();
|
||||
nativeMap.removeSource(source);
|
||||
}
|
||||
}
|
||||
|
||||
for (Map.Entry<String, Bitmap> bitmapEntry : images.entrySet()) {
|
||||
nativeMap.removeImage(bitmapEntry.getKey());
|
||||
bitmapEntry.getValue().recycle();
|
||||
|
||||
Reference in New Issue
Block a user