From 89af6f8007568a86132c9b4cc0a21356572a8bda Mon Sep 17 00:00:00 2001 From: Timothy Pearson Date: Sun, 24 Feb 2013 02:27:31 -0600 Subject: [PATCH] Restore expected qApp->exit() behaviour when called from a non-GUI thread --- src/kernel/qapplication.cpp | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/kernel/qapplication.cpp b/src/kernel/qapplication.cpp index 5b43301..591fc8d 100644 --- a/src/kernel/qapplication.cpp +++ b/src/kernel/qapplication.cpp @@ -2931,7 +2931,14 @@ int QApplication::exec() */ void QApplication::exit( int retcode ) { - qApp->eventLoop()->exit( retcode ); + QThread* thread = qApp->guiThread(); + if (thread) { + if (thread->d) { + if (thread->d->eventLoop) { + thread->d->eventLoop->exit( retcode ); + } + } + } } /*!