summaryrefslogtreecommitdiff
path: root/platform/android/src/async_task.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'platform/android/src/async_task.cpp')
-rw-r--r--platform/android/src/async_task.cpp9
1 files changed, 6 insertions, 3 deletions
diff --git a/platform/android/src/async_task.cpp b/platform/android/src/async_task.cpp
index 6c14e96fa6..0a4d90a275 100644
--- a/platform/android/src/async_task.cpp
+++ b/platform/android/src/async_task.cpp
@@ -16,6 +16,7 @@ public:
}
~Impl() {
+ queued = true;
loop->removeRunnable(this);
}
@@ -31,9 +32,11 @@ public:
}
void runTask() override {
- loop->removeRunnable(this);
- queued = true;
- task();
+ if (!queued) {
+ queued = true;
+ loop->removeRunnable(this);
+ task();
+ }
}
private: