diff options
author | Gabriel de Dietrich <gabriel.dedietrich@digia.com> | 2014-09-29 13:37:46 +0200 |
---|---|---|
committer | Gabriel de Dietrich <gabriel.dedietrich@digia.com> | 2014-09-29 13:38:11 +0200 |
commit | 8ab25620d3df25c43011ae982f4614639578afb3 (patch) | |
tree | e94d53c6b7d231ca18f0787a0c09bec07d163a67 /src/corelib/kernel/qobject.cpp | |
parent | dfe853bff90444edf92a993e391df853780c9e8d (diff) | |
parent | 5222abfdf5f034bad12bbe12312a4149550495b7 (diff) |
Merge remote-tracking branch 'origin/5.3' into 5.4
Conflicts:
src/network/socket/qnativesocketengine_unix.cpp
src/widgets/kernel/qwidget_qpa.cpp
Change-Id: I6f1aa320d5ca66cd92d601a95885aeaab0abb191
Diffstat (limited to 'src/corelib/kernel/qobject.cpp')
-rw-r--r-- | src/corelib/kernel/qobject.cpp | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/src/corelib/kernel/qobject.cpp b/src/corelib/kernel/qobject.cpp index 65b22021fd..e3e0f570e7 100644 --- a/src/corelib/kernel/qobject.cpp +++ b/src/corelib/kernel/qobject.cpp @@ -1465,14 +1465,14 @@ void QObject::moveToThread(QThread *targetThread) } QThreadData *currentData = QThreadData::current(); - QThreadData *targetData = targetThread ? QThreadData::get2(targetThread) : new QThreadData(0); + QThreadData *targetData = targetThread ? QThreadData::get2(targetThread) : Q_NULLPTR; if (d->threadData->thread == 0 && currentData == targetData) { // one exception to the rule: we allow moving objects with no thread affinity to the current thread currentData = d->threadData; } else if (d->threadData != currentData) { qWarning("QObject::moveToThread: Current thread (%p) is not the object's thread (%p).\n" "Cannot move to target thread (%p)\n", - currentData->thread, d->threadData->thread, targetData->thread); + currentData->thread, d->threadData->thread, targetData ? targetData->thread : Q_NULLPTR); #ifdef Q_OS_MAC qWarning("On Mac OS X, you might be loading two sets of Qt binaries into the same process. " @@ -1486,6 +1486,9 @@ void QObject::moveToThread(QThread *targetThread) // prepare to move d->moveToThread_helper(); + if (!targetData) + targetData = new QThreadData(0); + QOrderedMutexLocker locker(¤tData->postEventList.mutex, &targetData->postEventList.mutex); |