diff options
author | Juha Turunen <turunen@iki.fi> | 2015-10-11 20:29:51 -0700 |
---|---|---|
committer | Juha Turunen <juha.turunen@theqtcompany.com> | 2015-10-12 16:45:04 +0000 |
commit | a623fe8d2a60ff333d5779f877e3b20f0e141ff1 (patch) | |
tree | 020e3419e53eac73f471275d902134c693f4b48f /src/plugins/platforms/winrt/qwinrtmessagedialoghelper.cpp | |
parent | 5962c6e37e747044ab005ca53c7a90b4db210767 (diff) |
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>
Diffstat (limited to 'src/plugins/platforms/winrt/qwinrtmessagedialoghelper.cpp')
0 files changed, 0 insertions, 0 deletions