diff options
author | Tobrun Van Nuland <tobrun.van.nuland@gmail.com> | 2017-09-12 09:56:09 +0200 |
---|---|---|
committer | Tobrun <tobrun@mapbox.com> | 2017-09-26 11:43:33 +0200 |
commit | 95092df8e96514d59c777b6becd953ff1b187790 (patch) | |
tree | dbd12dc3099eb200b2b257f61d1432db7329aaaa | |
parent | 9596940638891b7041587f38f8c1aba19b0a1855 (diff) | |
download | qtlocation-mapboxgl-95092df8e96514d59c777b6becd953ff1b187790.tar.gz |
[android] - harden offline region deletion
-rw-r--r-- | platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/offline/OfflineRegion.java | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/offline/OfflineRegion.java b/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/offline/OfflineRegion.java index 1c78d5979e..ee6f8aa87f 100644 --- a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/offline/OfflineRegion.java +++ b/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/offline/OfflineRegion.java @@ -357,10 +357,10 @@ public class OfflineRegion { */ public void delete(@NonNull final OfflineRegionDeleteCallback callback) { if (!isDeleted) { + isDeleted = true; deleteOfflineRegion(new OfflineRegionDeleteCallback() { @Override public void onDelete() { - isDeleted = true; getHandler().post(new Runnable() { @Override public void run() { @@ -375,6 +375,7 @@ public class OfflineRegion { getHandler().post(new Runnable() { @Override public void run() { + isDeleted = false; callback.onError(error); } }); |