Use more Utils::isMainThread()

Change-Id: Ia3c6f6dca53c5d7487b0813de16f06c52af47aa5
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
This commit is contained in:
Jarek Kobus
2022-10-10 15:59:26 +02:00
parent 862a3923f4
commit f5f3bbcc59
13 changed files with 37 additions and 46 deletions

View File

@@ -3,10 +3,9 @@
#include "qtcassert.h"
#include "singleton.h"
#include "threadutils.h"
#include <QCoreApplication>
#include <QList>
#include <QThread>
#include <unordered_map>
@@ -45,7 +44,7 @@ SingletonStaticData &Singleton::staticData(std::type_index index)
// only.
void Singleton::deleteAll()
{
QTC_ASSERT(QThread::currentThread() == qApp->thread(), return);
QTC_ASSERT(isMainThread(), return);
QList<Singleton *> oldList;
{
QMutexLocker locker(&s_mutex);