forked from qt-creator/qt-creator
Utils: Fix crash in tests without QCoreApplication
Change-Id: Iefe451d75668a68ce86a5c4b80f738acd5d6e8e4 Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
This commit is contained in:
@@ -408,7 +408,9 @@ class DesktopFilePathWatcher final : public FilePathWatcher
|
|||||||
public:
|
public:
|
||||||
GlobalWatcher()
|
GlobalWatcher()
|
||||||
{
|
{
|
||||||
QTC_CHECK(QThread::currentThread() == qApp->thread());
|
// Normally we want to make sure that this object is created on the main thread.
|
||||||
|
// Certain tests might not have a qApp though, so we allow for that.
|
||||||
|
QTC_CHECK(!qApp || QThread::currentThread() == qApp->thread());
|
||||||
d.writeLocked()->init(this);
|
d.writeLocked()->init(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user