diff options
author | Bradley T. Hughes <bradley.hughes@nokia.com> | 2009-04-23 09:29:12 (GMT) |
---|---|---|
committer | Bradley T. Hughes <bradley.hughes@nokia.com> | 2009-04-23 10:10:59 (GMT) |
commit | 662f33a5b39f31579a2557a4d81469cfe30815c7 (patch) | |
tree | c56c2bcc9f4b1d28f30c76d44782bc4af4185c51 /src/corelib/thread | |
parent | d11cf4b8795a0f39e76432aa805f098388579d2d (diff) | |
download | Qt-662f33a5b39f31579a2557a4d81469cfe30815c7.zip Qt-662f33a5b39f31579a2557a4d81469cfe30815c7.tar.gz Qt-662f33a5b39f31579a2557a4d81469cfe30815c7.tar.bz2 |
Allow QThread to start a QTimer and QEventLoop before QCoreApplication is constructed
Fix a regression from 4.3 to 4.4 that prevented QThread from starting
timers and event loops before QCoreApplication was instantiated. Even
though this is documented not to work, it seems that people have been
relying on it.
This reverts commit e52e5acdfa198cd079bbfe3a9302debf46c7cadd which
attempted to work around not calling g_thread_init() multiple
times. The proper fix is to serialize the g_thread_supported() checks
in the Glib event dispatcher.
Task-number: 248191
Reviewed-by: denis
Diffstat (limited to 'src/corelib/thread')
-rw-r--r-- | src/corelib/thread/qthread_unix.cpp | 3 | ||||
-rw-r--r-- | src/corelib/thread/qthread_win.cpp | 3 |
2 files changed, 2 insertions, 4 deletions
diff --git a/src/corelib/thread/qthread_unix.cpp b/src/corelib/thread/qthread_unix.cpp index f602821..8f1c698 100644 --- a/src/corelib/thread/qthread_unix.cpp +++ b/src/corelib/thread/qthread_unix.cpp @@ -180,8 +180,7 @@ void *QThreadPrivate::start(void *arg) data->quitNow = false; // ### TODO: allow the user to create a custom event dispatcher - if (QCoreApplication::instance()) - createEventDispatcher(data); + createEventDispatcher(data); emit thr->started(); pthread_setcancelstate(PTHREAD_CANCEL_ENABLE, NULL); diff --git a/src/corelib/thread/qthread_win.cpp b/src/corelib/thread/qthread_win.cpp index 27193c6..7094e3d 100644 --- a/src/corelib/thread/qthread_win.cpp +++ b/src/corelib/thread/qthread_win.cpp @@ -292,8 +292,7 @@ unsigned int __stdcall QThreadPrivate::start(void *arg) data->quitNow = false; // ### TODO: allow the user to create a custom event dispatcher - if (QCoreApplication::instance()) - createEventDispatcher(data); + createEventDispatcher(data); #if !defined(QT_NO_DEBUG) && defined(Q_CC_MSVC) && !defined(Q_OS_WINCE) // sets the name of the current thread. |