From 550b8c342b32e518f79250620eaefd4714a873a1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tor=20Arne=20Vestb=C3=B8?= Date: Tue, 13 Feb 2018 14:47:18 +0100 Subject: [PATCH] Don't expect QCoreApplictionPrivate::eventDispatcher to be set MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit QCoreApplication::setEventDispatcher sets the dispatcher on the current thread, not on QCoreApplictionPrivate, so when running init() we don't have an event dispatcher set. Change-Id: Ia008e68b70777779ab14f1f7b9eeadac9adbcf7b Reviewed-by: Thiago Macieira Reviewed-by: Tor Arne Vestbø --- src/corelib/kernel/qcoreapplication.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/corelib/kernel/qcoreapplication.cpp b/src/corelib/kernel/qcoreapplication.cpp index 4bab0b9f01..b56031e625 100644 --- a/src/corelib/kernel/qcoreapplication.cpp +++ b/src/corelib/kernel/qcoreapplication.cpp @@ -848,8 +848,9 @@ void QCoreApplicationPrivate::init() #ifndef QT_NO_QOBJECT // use the event dispatcher created by the app programmer (if any) - if (!eventDispatcher) - eventDispatcher = threadData->eventDispatcher.load(); + Q_ASSERT(!eventDispatcher); + eventDispatcher = threadData->eventDispatcher.load(); + // otherwise we create one if (!eventDispatcher) createEventDispatcher();