summaryrefslogtreecommitdiffstats
path: root/src/corelib/thread/qthread_win.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/corelib/thread/qthread_win.cpp')
-rw-r--r--src/corelib/thread/qthread_win.cpp7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/corelib/thread/qthread_win.cpp b/src/corelib/thread/qthread_win.cpp
index 820ffa1149..8aa3f4c58b 100644
--- a/src/corelib/thread/qthread_win.cpp
+++ b/src/corelib/thread/qthread_win.cpp
@@ -316,7 +316,12 @@ unsigned int __stdcall QT_ENSURE_STACK_ALIGNED_FOR_SSE QThreadPrivate::start(voi
#if !defined(QT_NO_DEBUG) && defined(Q_CC_MSVC)
// sets the name of the current thread.
- QByteArray objectName = thr->objectName().toLocal8Bit();
+
+ // avoid interacting with the binding system while thread is
+ // not properly running yet
+ auto priv = QObjectPrivate::get(thr);
+ QByteArray objectName = (priv->extraData ? priv->extraData->objectName.valueBypassingBindings()
+ : QString()).toLocal8Bit();
qt_set_thread_name(HANDLE(-1),
objectName.isEmpty() ?
thr->metaObject()->className() : objectName.constData());