summaryrefslogtreecommitdiffstats
path: root/src/corelib/kernel/qeventdispatcher_unix.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/corelib/kernel/qeventdispatcher_unix.cpp')
-rw-r--r--src/corelib/kernel/qeventdispatcher_unix.cpp14
1 files changed, 11 insertions, 3 deletions
diff --git a/src/corelib/kernel/qeventdispatcher_unix.cpp b/src/corelib/kernel/qeventdispatcher_unix.cpp
index 6aa3b56fa7..f7293d4b7a 100644
--- a/src/corelib/kernel/qeventdispatcher_unix.cpp
+++ b/src/corelib/kernel/qeventdispatcher_unix.cpp
@@ -420,10 +420,18 @@ bool QTimerInfoList::timerWait(timeval &tm)
timeval currentTime = updateCurrentTime();
repairTimersIfNeeded();
- if (isEmpty())
- return false;
+ // Find first waiting timer not already active
+ QTimerInfo *t = 0;
+ for (QTimerInfoList::const_iterator it = constBegin(); it != constEnd(); ++it) {
+ if (!(*it)->inTimerEvent) {
+ t = *it;
+ break;
+ }
+ }
+
+ if (!t)
+ return false;
- QTimerInfo *t = first(); // first waiting timer
if (currentTime < t->timeout) {
// time to wait
tm = t->timeout - currentTime;