summaryrefslogtreecommitdiffstats
path: root/src/corelib/kernel/qcoreapplication.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/corelib/kernel/qcoreapplication.cpp')
-rw-r--r--src/corelib/kernel/qcoreapplication.cpp13
1 files changed, 10 insertions, 3 deletions
diff --git a/src/corelib/kernel/qcoreapplication.cpp b/src/corelib/kernel/qcoreapplication.cpp
index dd52242c6f..86530f0cfc 100644
--- a/src/corelib/kernel/qcoreapplication.cpp
+++ b/src/corelib/kernel/qcoreapplication.cpp
@@ -1975,11 +1975,18 @@ void QCoreApplication::quit()
if (!self)
return;
- if (QThread::currentThread() == self->d_func()->mainThread()) {
+ self->d_func()->quit();
+}
+
+void QCoreApplicationPrivate::quit()
+{
+ Q_Q(QCoreApplication);
+
+ if (QThread::currentThread() == mainThread()) {
QEvent quitEvent(QEvent::Quit);
- QCoreApplication::sendEvent(self, &quitEvent);
+ QCoreApplication::sendEvent(q, &quitEvent);
} else {
- QCoreApplication::postEvent(self, new QEvent(QEvent::Quit));
+ QCoreApplication::postEvent(q, new QEvent(QEvent::Quit));
}
}