[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:
Juha Alanen
2020-01-09 15:58:44 +02:00
parent 60a4b3eda3
commit f24e4ca068

View File

@@ -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;
}
}