summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTobrun Van Nuland <tobrun.van.nuland@gmail.com>2017-09-12 09:56:09 +0200
committerTobrun <tobrun@mapbox.com>2017-09-14 07:44:56 +0200
commitf0bf2c94aecf2a657d9338216a5ee9179270370a (patch)
tree16b3356a7f8d4b82ef4d14e7eae1e5da17ab491c
parent03d321a6c44773aff93c7e3bda220a3168939e51 (diff)
downloadqtlocation-mapboxgl-f0bf2c94aecf2a657d9338216a5ee9179270370a.tar.gz
[android] - harden offline region deletion
-rw-r--r--platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/offline/OfflineRegion.java3
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 1b8c4121ef..f210729037 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
@@ -358,10 +358,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() {
@@ -376,6 +376,7 @@ public class OfflineRegion {
getHandler().post(new Runnable() {
@Override
public void run() {
+ isDeleted = false;
callback.onError(error);
}
});