summaryrefslogtreecommitdiffstats
path: root/src/corelib
diff options
context:
space:
mode:
authorMorten Johan Sørvig <morten.sorvig@qt.io>2018-05-14 16:41:45 +0200
committerMorten Johan Sørvig <morten.sorvig@qt.io>2018-05-15 08:33:02 +0000
commitfe9f03de743e179dcaa2247390201dadd55a5ef3 (patch)
tree9d68f68a1285ecb262bbcc960f7207c728fe4f7c /src/corelib
parentc0fa45138c64f0176f51f584a7940db8ea8f0e6a (diff)
wasm: further sync up QThreadData::current()
Sync the NO_THREAD implementation with the qthread_unix one. Change-Id: Ib6db148a68c040a9bf7227f633892e208840cf01 Reviewed-by: Lorn Potter <lorn.potter@gmail.com>
Diffstat (limited to 'src/corelib')
-rw-r--r--src/corelib/thread/qthread.cpp2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/corelib/thread/qthread.cpp b/src/corelib/thread/qthread.cpp
index 5c9855be6d..5e7a214eaa 100644
--- a/src/corelib/thread/qthread.cpp
+++ b/src/corelib/thread/qthread.cpp
@@ -778,6 +778,8 @@ QThreadData* QThreadData::current(bool createIfNecessary)
if (!data) {
data = new QThreadData;
data->thread = new QAdoptedThread(data);
+ data->deref();
+ data->isAdopted = true;
data->threadId.store(Qt::HANDLE(data->thread));
if (!QCoreApplicationPrivate::theMainThread)
QCoreApplicationPrivate::theMainThread = data->thread.load();