From f24e4ca0689c023cf5499c4a78ba7a20b3e9a4c0 Mon Sep 17 00:00:00 2001 From: Juha Alanen Date: Thu, 9 Jan 2020 15:58:44 +0200 Subject: [PATCH] [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. --- platform/android/src/run_loop.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/platform/android/src/run_loop.cpp b/platform/android/src/run_loop.cpp index a9cbfb57a..d62816d8c 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; } }