QProcess/Win: Avoid reentering the code in _q_processDied()

In case drainOutputPipes() makes a recursion, setting 'dying' to true
should protect the code from reentering. But, the next call to
QProcessPrivate::cleanup() resets this variable, which allows a
secondary pass. So, we should postpone setting 'dying' to false until
a new process session is started.

Fixes: QTBUG-33731
Change-Id: I269ad3b8defa32aa714ea13f8803a07259f475dc
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@gmx.de>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
This commit is contained in:
Alex Trotsenko 2020-06-05 13:35:16 +03:00
parent 10f8ebe3e2
commit 7aa327648c

View File

@ -894,7 +894,6 @@ void QProcessPrivate::cleanup()
#endif
pid = 0;
sequenceNumber = 0;
dying = false;
if (stdoutChannel.notifier) {
delete stdoutChannel.notifier;
@ -2148,6 +2147,7 @@ void QProcessPrivate::start(QIODevice::OpenMode mode)
stderrChannel.closed = false;
exitCode = 0;
dying = false;
exitStatus = QProcess::NormalExit;
processError = QProcess::UnknownError;
errorString.clear();