diff options
author | Philip Van Hoof <philip@codeminded.be> | 2010-11-01 15:59:44 (GMT) |
---|---|---|
committer | Ville Pernu <ville.pernu@nokia.com> | 2010-11-12 13:31:46 (GMT) |
commit | 4f8d55c493db989984ec64bd05453e14d7a0cab2 (patch) | |
tree | 8ac56046a319ce28b7fce84c6e27465bffb1dcdf | |
parent | f31f50852b8bbfc658708be44e7d495637a63f4f (diff) | |
download | Qt-4f8d55c493db989984ec64bd05453e14d7a0cab2.zip Qt-4f8d55c493db989984ec64bd05453e14d7a0cab2.tar.gz Qt-4f8d55c493db989984ec64bd05453e14d7a0cab2.tar.bz2 |
Push and pop the thread-default context for the current thread
Merge-request: 869
Reviewed-by: Thiago Macieira <thiago.macieira@nokia.com>
(cherry picked from commit aa88b7044dd86850e6986aa80104bb38bb7b12eb)
-rw-r--r-- | src/corelib/kernel/qeventdispatcher_glib.cpp | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/src/corelib/kernel/qeventdispatcher_glib.cpp b/src/corelib/kernel/qeventdispatcher_glib.cpp index 8390275..6fa2707 100644 --- a/src/corelib/kernel/qeventdispatcher_glib.cpp +++ b/src/corelib/kernel/qeventdispatcher_glib.cpp @@ -311,6 +311,10 @@ QEventDispatcherGlibPrivate::QEventDispatcherGlibPrivate(GMainContext *context) } } +#if GLIB_CHECK_VERSION (2, 22, 0) + g_main_context_push_thread_default (mainContext); +#endif + // setup post event source postEventSource = reinterpret_cast<GPostEventSource *>(g_source_new(&postEventSourceFuncs, sizeof(GPostEventSource))); @@ -389,6 +393,9 @@ QEventDispatcherGlib::~QEventDispatcherGlib() d->postEventSource = 0; Q_ASSERT(d->mainContext != 0); +#if GLIB_CHECK_VERSION (2, 22, 0) + g_main_context_pop_thread_default (d->mainContext); +#endif g_main_context_unref(d->mainContext); d->mainContext = 0; } |