summaryrefslogtreecommitdiffstats
path: root/src/corelib/kernel/qobject.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/corelib/kernel/qobject.cpp')
-rw-r--r--src/corelib/kernel/qobject.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/corelib/kernel/qobject.cpp b/src/corelib/kernel/qobject.cpp
index 55cf464..05015c0 100644
--- a/src/corelib/kernel/qobject.cpp
+++ b/src/corelib/kernel/qobject.cpp
@@ -1121,13 +1121,13 @@ bool QObject::event(QEvent *e)
QThreadData *threadData = d->threadData;
QAbstractEventDispatcher *eventDispatcher = threadData->eventDispatcher;
if (eventDispatcher) {
- // set inThreadChangeEvent to true to tell the dispatcher not to release out timer ids
- // back to the pool (since the timer ids are moving to a new thread).
- d->inThreadChangeEvent = true;
QList<QPair<int, int> > timers = eventDispatcher->registeredTimers(this);
- d->inThreadChangeEvent = false;
if (!timers.isEmpty()) {
+ // set inThreadChangeEvent to true to tell the dispatcher not to release out timer ids
+ // back to the pool (since the timer ids are moving to a new thread).
+ d->inThreadChangeEvent = true;
eventDispatcher->unregisterTimers(this);
+ d->inThreadChangeEvent = false;
QMetaObject::invokeMethod(this, "_q_reregisterTimers", Qt::QueuedConnection,
Q_ARG(void*, (new QList<QPair<int, int> >(timers))));
}