qt5base-lts/tests/auto/corelib/kernel
Juha Turunen a623fe8d2a Fixed a QTimer::singleShot() crash when a functor callback is used
If QTimer::singleShot() is used with a functor callback and a context
object with different thread affinity than the caller, a crash can
occur. If the context object's thread is scheduled before
connecting to QCoreApplication::aboutToQuit(), the timer has a change
to fire and QSingleShotTimer::timerEvent() will delete the
QSingleShotTimer object making the this pointer used in the
connection invalid. This can occur relatively often if an interval
of 0 is used.

Making the moveToThread() call the last thing in the constructor
ensures that the constructor gets to run to completion before the
timer has a chance to fire.

Task-number: QTBUG-48700
Change-Id: Iab73d02933635821b8d1ca1ff3d53e92eca85834
Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
2015-10-12 16:45:04 +00:00
..
qcoreapplication Merge remote-tracking branch 'origin/5.5' into 5.6 2015-10-02 16:59:55 +02:00
qeventdispatcher Blacklist and skip various tests that are flakey 2015-06-14 10:50:45 +00:00
qeventloop Stabilize qguieventloop test. 2015-09-24 07:36:25 +00:00
qmath Update copyright headers 2015-02-11 06:49:51 +00:00
qmetaenum Fix QtPrivate::IsQEnumHelper<void> 2015-05-17 09:13:18 +00:00
qmetamethod Update copyright headers 2015-02-11 06:49:51 +00:00
qmetaobject Output registered enums in qDebug operator for QFlags. 2015-02-26 12:16:51 +00:00
qmetaobjectbuilder Update copyright headers 2015-02-11 06:49:51 +00:00
qmetaproperty QMetaProperty::write should reset the property if an empty QVariant is given 2015-10-09 15:26:38 +00:00
qmetatype Use QTypeInfo<T>::isRelocatable in QVariant 2015-09-24 16:55:10 +00:00
qmimedata Tests: Replace Q[TRY]_VERIFY(v == true|false) by QVERIFY(v)|QVERIFY(!v). 2015-07-27 12:09:19 +00:00
qobject QMetaProperty::write should reset the property if an empty QVariant is given 2015-10-09 15:26:38 +00:00
qpointer QPointer: add member-swap 2015-06-17 07:09:57 +00:00
qsharedmemory Skip instead of entirely excluding tests with disabled features 2015-03-16 09:34:15 +00:00
qsignalblocker Update copyright headers 2015-02-11 06:49:51 +00:00
qsignalmapper Update copyright headers 2015-02-11 06:49:51 +00:00
qsocketnotifier Merge remote-tracking branch 'origin/5.5' into 5.6 2015-10-02 16:59:55 +02:00
qsystemsemaphore Skip instead of entirely excluding tests with disabled features 2015-03-16 09:34:15 +00:00
qtimer Fixed a QTimer::singleShot() crash when a functor callback is used 2015-10-12 16:45:04 +00:00
qtranslator Update copyright headers 2015-02-11 06:49:51 +00:00
qvariant Merge remote-tracking branch 'origin/5.5' into dev 2015-03-16 10:31:07 +01:00
qwineventnotifier Update copyright headers 2015-02-11 06:49:51 +00:00
kernel.pro iOS: Skip tests that don't make sense or don't work on the platform 2015-03-16 14:25:27 +00:00