diff --git a/src/corelib/thread/qthread_win.cpp b/src/corelib/thread/qthread_win.cpp index a193595532..3e0eef411a 100644 --- a/src/corelib/thread/qthread_win.cpp +++ b/src/corelib/thread/qthread_win.cpp @@ -88,7 +88,7 @@ QThreadData *QThreadData::current(bool createIfNecessary) threadData->threadId.storeRelaxed(reinterpret_cast(quintptr(GetCurrentThreadId()))); if (!QCoreApplicationPrivate::theMainThreadId) { - QCoreApplicationPrivate::theMainThread = threadData->thread.loadRelaxed(); + QCoreApplicationPrivate::theMainThread.storeRelease(threadData->thread.loadRelaxed()); QCoreApplicationPrivate::theMainThreadId.storeRelaxed(threadData->threadId.loadRelaxed()); } else { HANDLE realHandle = INVALID_HANDLE_VALUE;