[android] Check flag before runnable task invocation
This commit is contained in:
@@ -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:
|
||||
|
||||
Reference in New Issue
Block a user