QThread: print thread name in the warning message

Print thread name in the warning message "QThread: Destroyed while
thread is still running". This can be useful to determine which
exactly thread is being deleted incorrectly, especially when you
can't reproduce this in debug mode and you only have the user log.

Change-Id: If9c57e1528b24fe3789930e3e144f61e6761c66a
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
This commit is contained in:
Vladimir Belyavsky 2024-09-09 08:57:36 +03:00
parent bf1a2ba8ef
commit 07749de7ef

View File

@ -494,7 +494,7 @@ QThread::~QThread()
locker.relock();
}
if (d->threadState == QThreadPrivate::Running && !d->data->isAdopted)
qFatal("QThread: Destroyed while thread is still running");
qFatal("QThread: Destroyed while thread '%ls' is still running", qUtf16Printable(objectName()));
d->data->thread.storeRelease(nullptr);
}