QtCore: code tidies: use the 4-arg connect overload
The 3-arg connect is error-prone and makes the lifetime of the connection unclear. Change-Id: I4f2b54bc086e8f4723a0357d983e3df2f85135ac Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
This commit is contained in:
parent
838fc606c1
commit
7297cd808b
@ -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();
|
||||
|
@ -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()
|
||||
|
Loading…
Reference in New Issue
Block a user