summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/corelib/kernel/qapplicationstatic.h3
-rw-r--r--src/corelib/thread/qthread.cpp4
2 files changed, 5 insertions, 2 deletions
diff --git a/src/corelib/kernel/qapplicationstatic.h b/src/corelib/kernel/qapplicationstatic.h
index 1eadeb20e2a..f2f09118562 100644
--- a/src/corelib/kernel/qapplicationstatic.h
+++ b/src/corelib/kernel/qapplicationstatic.h
@@ -50,7 +50,8 @@ template <typename QAS> struct ApplicationHolder
QMutexLocker locker(&mutex);
if (guard.loadRelaxed() == QtGlobalStatic::Uninitialized) {
QAS::innerFunction(&storage);
- QObject::connect(QCoreApplication::instance(), &QObject::destroyed, reset);
+ const auto *app = QCoreApplication::instance();
+ QObject::connect(app, &QObject::destroyed, app, reset, Qt::DirectConnection);
guard.storeRelease(QtGlobalStatic::Initialized);
}
return realPointer();
diff --git a/src/corelib/thread/qthread.cpp b/src/corelib/thread/qthread.cpp
index 9f00bf407db..61369420d14 100644
--- a/src/corelib/thread/qthread.cpp
+++ b/src/corelib/thread/qthread.cpp
@@ -1245,7 +1245,9 @@ QDaemonThread::QDaemonThread(QObject *parent)
{
// QThread::started() is emitted from the thread we start
connect(this, &QThread::started,
- [](){ QThreadData::current()->requiresCoreApplication = false; });
+ this,
+ [](){ QThreadData::current()->requiresCoreApplication = false; },
+ Qt::DirectConnection);
}
QDaemonThread::~QDaemonThread()