From 07749de7ef59827a2deb2719cd20208bdce201e2 Mon Sep 17 00:00:00 2001 From: Vladimir Belyavsky Date: Mon, 9 Sep 2024 08:57:36 +0300 Subject: [PATCH] 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 --- src/corelib/thread/qthread.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/corelib/thread/qthread.cpp b/src/corelib/thread/qthread.cpp index aa3bb00b7ba..0f939abf156 100644 --- a/src/corelib/thread/qthread.cpp +++ b/src/corelib/thread/qthread.cpp @@ -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); }