[android] Check flag before runnable task invocation

This commit is contained in:
Alexander Shalamov
2019-08-08 17:15:25 +03:00
parent 050b3360ec
commit a8558379db
2 changed files with 15 additions and 6 deletions

View File

@@ -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: