summaryrefslogtreecommitdiffstats
path: root/src/corelib/kernel/qbasictimer.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/corelib/kernel/qbasictimer.cpp')
-rw-r--r--src/corelib/kernel/qbasictimer.cpp10
1 files changed, 4 insertions, 6 deletions
diff --git a/src/corelib/kernel/qbasictimer.cpp b/src/corelib/kernel/qbasictimer.cpp
index ea8f8e2c77..623ecb9b8b 100644
--- a/src/corelib/kernel/qbasictimer.cpp
+++ b/src/corelib/kernel/qbasictimer.cpp
@@ -216,13 +216,11 @@ void QBasicTimer::stop()
{
if (id) {
QAbstractEventDispatcher *eventDispatcher = QAbstractEventDispatcher::instance();
- if (eventDispatcher) {
- if (Q_UNLIKELY(!eventDispatcher->unregisterTimer(id))) {
- qWarning("QBasicTimer::stop: Failed. Possibly trying to stop from a different thread");
- return;
- }
- QAbstractEventDispatcherPrivate::releaseTimerId(id);
+ if (eventDispatcher && !eventDispatcher->unregisterTimer(id)) {
+ qWarning("QBasicTimer::stop: Failed. Possibly trying to stop from a different thread");
+ return;
}
+ QAbstractEventDispatcherPrivate::releaseTimerId(id);
}
id = 0;
}