summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJuha Alanen <juha.alanen@mapbox.com>2020-01-09 15:58:44 +0200
committerJuha Alanen <juha.alanen@mapbox.com>2020-01-10 17:19:30 +0200
commitf24e4ca0689c023cf5499c4a78ba7a20b3e9a4c0 (patch)
tree83a62370228668f156cd0bcaea814b7f30a7c072
parent60a4b3eda3d2d144a5845505649beeaefde6055b (diff)
downloadqtlocation-mapboxgl-f24e4ca0689c023cf5499c4a78ba7a20b3e9a4c0.tar.gz
[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.
-rw-r--r--platform/android/src/run_loop.cpp3
1 files changed, 1 insertions, 2 deletions
diff --git a/platform/android/src/run_loop.cpp b/platform/android/src/run_loop.cpp
index a9cbfb57aa..d62816d8cd 100644
--- a/platform/android/src/run_loop.cpp
+++ b/platform/android/src/run_loop.cpp
@@ -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;
}
}