diff options
author | Ivo van Dongen <info@ivovandongen.nl> | 2016-09-09 13:21:41 +0200 |
---|---|---|
committer | Ivo van Dongen <info@ivovandongen.nl> | 2016-09-23 10:47:54 +0200 |
commit | e968f4ed55c194b73d8d10e3c3846e9798c8693d (patch) | |
tree | 7aad28e5a9008076e0e56ceef8a8c88b7218c06b | |
parent | 742d6d827567608f94b0743b7bac5dbef94724e3 (diff) | |
download | qtlocation-mapboxgl-e968f4ed55c194b73d8d10e3c3846e9798c8693d.tar.gz |
[android] timer - prevent overflow in due time
-rw-r--r-- | platform/android/src/timer.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/platform/android/src/timer.cpp b/platform/android/src/timer.cpp index 7057d6de70..2eb003b2bd 100644 --- a/platform/android/src/timer.cpp +++ b/platform/android/src/timer.cpp @@ -23,8 +23,8 @@ public: repeat = repeat_; task = std::move(task_); - due = Clock::now() + timeout; - + //Prevent overflows when timeout is set to Duration::max() + due = (timeout == Duration::max()) ? std::chrono::time_point<Clock>::max() : Clock::now() + timeout; loop->addRunnable(this); } |