Correctly initialize adopted threads in stub implementation
Set data->threadId, which makes the thread detection used by Qt::AutoConnection work: it will now actually select Qt::DirectConnection. Change-Id: I9369e47eb7ed3ec88dba25f2d41e92139958bcd7 Reviewed-by: Lorn Potter <lorn.potter@gmail.com>
This commit is contained in:
parent
d9d35b9fb6
commit
07f6eff58d
@ -778,7 +778,9 @@ QThreadData *QThreadData::current(bool createIfNecessary)
|
||||
if (!data && createIfNecessary) {
|
||||
data = new QThreadData;
|
||||
data->thread = new QAdoptedThread(data);
|
||||
data->threadId.store(Qt::HANDLE(data->thread));
|
||||
data->deref();
|
||||
data->isAdopted = true;
|
||||
if (!QCoreApplicationPrivate::theMainThread)
|
||||
QCoreApplicationPrivate::theMainThread = data->thread.load();
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user