From 7aa327648c2f2744e381582a98813a545b4f1cb1 Mon Sep 17 00:00:00 2001 From: Alex Trotsenko Date: Fri, 5 Jun 2020 13:35:16 +0300 Subject: 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 Reviewed-by: Thiago Macieira --- src/corelib/io/qprocess.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/corelib/io/qprocess.cpp b/src/corelib/io/qprocess.cpp index 633777fd5c..5e19f7256f 100644 --- a/src/corelib/io/qprocess.cpp +++ b/src/corelib/io/qprocess.cpp @@ -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(); -- cgit v1.2.3