X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/1d043598b7e6baae2e0a472a4133b8d60f0f45ec..28f12ffb86b5a32c7eaa596a095f4b01890c9f46:/src/unix/timerunx.cpp diff --git a/src/unix/timerunx.cpp b/src/unix/timerunx.cpp index 158736fcb3..c3c563af04 100644 --- a/src/unix/timerunx.cpp +++ b/src/unix/timerunx.cpp @@ -172,7 +172,11 @@ void wxTimerScheduler::NotifyExpired() } else // reschedule the next timer expiration { - s->m_expiration += timer->GetInterval()*1000; + // always keep the expiration time in the future, i.e. base it on + // the current time instead of just offsetting it from the current + // expiration time because it could happen that we're late and the + // current expiration time is (far) in the past + s->m_expiration = now + timer->GetInterval()*1000; DoAddTimer(s); }