From d45242a64a347a84b0c9213d4adcd732ece39cb3 Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Wed, 15 Oct 2008 11:39:04 +0000 Subject: [PATCH] base new timer expiration time on current time, not on the previous expiration time git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@56327 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- src/unix/timerunx.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) 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); }