ProcessLauncher: avoid reading stderr for merged channels

This will assert on Qt 6.3.0 and print a warning for Qt 6.3.1 and later.

Change-Id: I837fbde3358a5a0e5cc29b8486ed7b4e9837a976
Fixes: QTCREATORBUG-27385
Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io>
This commit is contained in:
Aaron Barany
2022-04-19 01:24:43 -07:00
parent 6015a4d839
commit 90e879bbd1

View File

@@ -182,6 +182,7 @@ void LauncherSocketHandler::handleProcessFinished()
packet.errorString = proc->errorString(); packet.errorString = proc->errorString();
packet.exitCode = proc->exitCode(); packet.exitCode = proc->exitCode();
packet.exitStatus = proc->exitStatus(); packet.exitStatus = proc->exitStatus();
if (proc->processChannelMode() != QProcess::MergedChannels)
packet.stdErr = proc->readAllStandardError(); packet.stdErr = proc->readAllStandardError();
packet.stdOut = proc->readAllStandardOutput(); packet.stdOut = proc->readAllStandardOutput();
sendPacket(packet); sendPacket(packet);
@@ -257,6 +258,7 @@ void LauncherSocketHandler::handleStopPacket()
packet.error = QProcess::Crashed; packet.error = QProcess::Crashed;
packet.exitCode = -1; packet.exitCode = -1;
packet.exitStatus = QProcess::CrashExit; packet.exitStatus = QProcess::CrashExit;
if (process->processChannelMode() != QProcess::MergedChannels)
packet.stdErr = process->readAllStandardError(); packet.stdErr = process->readAllStandardError();
packet.stdOut = process->readAllStandardOutput(); packet.stdOut = process->readAllStandardOutput();
sendPacket(packet); sendPacket(packet);