diff options
author | Simon Hausmann <simon.hausmann@nokia.com> | 2009-04-23 11:17:59 (GMT) |
---|---|---|
committer | Simon Hausmann <simon.hausmann@nokia.com> | 2009-04-23 11:17:59 (GMT) |
commit | d1f67f4287b7536b068672fbb7fd31ad02306ca3 (patch) | |
tree | 7012b90a083a1976bd1d68707290699d5fc08b47 /src/corelib/kernel | |
parent | e8974548e30a28738b46c681a7e50c27aab27db6 (diff) | |
parent | 148cb8d26d46067676677fde1cfb81d5d5c6d81b (diff) | |
download | Qt-d1f67f4287b7536b068672fbb7fd31ad02306ca3.zip Qt-d1f67f4287b7536b068672fbb7fd31ad02306ca3.tar.gz Qt-d1f67f4287b7536b068672fbb7fd31ad02306ca3.tar.bz2 |
Merge branch '4.5' of git@scm.dev.nokia.troll.no:qt/qt
Diffstat (limited to 'src/corelib/kernel')
-rw-r--r-- | src/corelib/kernel/qeventdispatcher_glib.cpp | 3 | ||||
-rw-r--r-- | src/corelib/kernel/qeventloop.cpp | 5 |
2 files changed, 6 insertions, 2 deletions
diff --git a/src/corelib/kernel/qeventdispatcher_glib.cpp b/src/corelib/kernel/qeventdispatcher_glib.cpp index 3fd768a..3c5b277 100644 --- a/src/corelib/kernel/qeventdispatcher_glib.cpp +++ b/src/corelib/kernel/qeventdispatcher_glib.cpp @@ -42,6 +42,7 @@ #include "qeventdispatcher_glib_p.h" #include "qeventdispatcher_unix_p.h" +#include <private/qmutexpool_p.h> #include <private/qthread_p.h> #include "qcoreapplication.h" @@ -224,6 +225,8 @@ QEventDispatcherGlibPrivate::QEventDispatcherGlibPrivate(GMainContext *context) : mainContext(context) { if (qgetenv("QT_NO_THREADED_GLIB").isEmpty()) { + static int dummyValue = 0; // only used for its address + QMutexLocker locker(QMutexPool::instance()->get(&dummyValue)); if (!g_thread_supported()) g_thread_init(NULL); } diff --git a/src/corelib/kernel/qeventloop.cpp b/src/corelib/kernel/qeventloop.cpp index 92bdf73..600f787 100644 --- a/src/corelib/kernel/qeventloop.cpp +++ b/src/corelib/kernel/qeventloop.cpp @@ -188,8 +188,9 @@ int QEventLoop::exec(ProcessEventsFlags flags) d->threadData->eventLoops.push(this); // remove posted quit events when entering a new event loop - if (qApp->thread() == thread()) - QCoreApplication::removePostedEvents(qApp, QEvent::Quit); + QCoreApplication *app = QCoreApplication::instance(); + if (app && app->thread() == thread()) + QCoreApplication::removePostedEvents(app, QEvent::Quit); #if defined(QT_NO_EXCEPTIONS) while (!d->exit) |