[android] Fix a RunLoop bug where tasks are run only once
Do not remove tasks from the RunLoop in processRunnables(). Otherwise the task is run only once.
This commit is contained in:
@@ -170,11 +170,10 @@ Milliseconds RunLoop::Impl::processRunnables() {
|
||||
auto const dueTime = runnable->dueTime();
|
||||
if (dueTime <= now) {
|
||||
tmp.push_back(runnable);
|
||||
runnables.erase(it++);
|
||||
} else {
|
||||
nextDue = std::min(nextDue, dueTime);
|
||||
++it;
|
||||
}
|
||||
++it;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user