From e60e2bf7655c12a1a923665fcb366b9f462276d3 Mon Sep 17 00:00:00 2001 From: Giuseppe D'Angelo Date: Wed, 28 Feb 2024 10:54:39 +0100 Subject: [PATCH] QThread: set the thread name on Windows even in release builds of Qt It's not really clear why this feature shouldn't work in release builds of Qt. This aligns the behavior with UNIX. Change-Id: I6a2f50640ab0b2e109e4c3ef7317954a3e8c79a2 Reviewed-by: Thiago Macieira --- src/corelib/thread/qthread_win.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/corelib/thread/qthread_win.cpp b/src/corelib/thread/qthread_win.cpp index 34217896cf..793c7cdc68 100644 --- a/src/corelib/thread/qthread_win.cpp +++ b/src/corelib/thread/qthread_win.cpp @@ -246,7 +246,7 @@ unsigned int __stdcall QT_ENSURE_STACK_ALIGNED_FOR_SSE QThreadPrivate::start(voi data->ensureEventDispatcher(); data->eventDispatcher.loadRelaxed()->startingUp(); -#if !defined(QT_NO_DEBUG) && defined(Q_CC_MSVC) +#if defined(Q_CC_MSVC) // sets the name of the current thread. QString threadName = std::exchange(thr->d_func()->objectName, {}); if (Q_LIKELY(threadName.isEmpty()))