From b3b95670b2f7e43cfe49fa90f2dffa74b82c160f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Morten=20Johan=20S=C3=B8rvig?= Date: Wed, 9 Dec 2020 16:31:41 +0100 Subject: Call QEventDispatcher::startingUp() on thread start ...instead of during createEventDispatcher(). This way, startingUp() will be called [on the thread being started] also for custom event dispatchers installed with QThread::setEventDispatcher(). This prevents crashes when installing event dispatches which expects that startingUp() will be called. Crash reproducible with test case from QTBUG-51961. Change-Id: I71bd696539689d928a61ff9b47d05297cf803b2f Reviewed-by: Thiago Macieira --- src/corelib/thread/qthread.cpp | 1 - 1 file changed, 1 deletion(-) (limited to 'src/corelib/thread/qthread.cpp') diff --git a/src/corelib/thread/qthread.cpp b/src/corelib/thread/qthread.cpp index 543c491201b..3453fd0fc17 100644 --- a/src/corelib/thread/qthread.cpp +++ b/src/corelib/thread/qthread.cpp @@ -125,7 +125,6 @@ QAbstractEventDispatcher *QThreadData::createEventDispatcher() { QAbstractEventDispatcher *ed = QThreadPrivate::createEventDispatcher(this); eventDispatcher.storeRelease(ed); - ed->startingUp(); return ed; } -- cgit v1.2.3