forked from qt-creator/qt-creator
Make all objects created by QtcProcess children of it
Sometimes after creating QtcProcess we move it into a different thread. In this case we should move all the children, too. Without parent-child relation all the children will stay in the old thread. Change-Id: Ibde44d6153092a155dd2d200a7116a046910dddc Reviewed-by: Christian Kandeler <christian.kandeler@qt.io> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
This commit is contained in:
@@ -810,14 +810,14 @@ void LauncherSocket::sendData(const QByteArray &data)
|
||||
QMetaObject::invokeMethod(this, &LauncherSocket::handleRequests);
|
||||
}
|
||||
|
||||
CallerHandle *LauncherSocket::registerHandle(quintptr token, ProcessMode mode)
|
||||
CallerHandle *LauncherSocket::registerHandle(QObject *parent, quintptr token, ProcessMode mode)
|
||||
{
|
||||
QTC_ASSERT(!isCalledFromLaunchersThread(), return nullptr);
|
||||
QMutexLocker locker(&m_mutex);
|
||||
if (m_handles.contains(token))
|
||||
return nullptr; // TODO: issue a warning
|
||||
|
||||
CallerHandle *callerHandle = new CallerHandle(token, mode);
|
||||
CallerHandle *callerHandle = new CallerHandle(parent, token, mode);
|
||||
LauncherHandle *launcherHandle = new LauncherHandle(token, mode);
|
||||
callerHandle->setLauncherHandle(launcherHandle);
|
||||
launcherHandle->setCallerHandle(callerHandle);
|
||||
|
||||
Reference in New Issue
Block a user