forked from qt-creator/qt-creator
Prevent infinite loop when user chooses not to terminate hanged process
Happens if the process is already terminated Change-Id: I660779dc701d1fe8b41562f68f0ce95c6e87058f Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
This commit is contained in:
committed by
Orgad Shaneh
parent
40a1b4afb7
commit
9dd3a14f28
@@ -560,7 +560,7 @@ bool SynchronousProcess::readDataFromProcess(QProcess &p, int timeOutMS,
|
|||||||
bool finished = false;
|
bool finished = false;
|
||||||
bool hasData = false;
|
bool hasData = false;
|
||||||
do {
|
do {
|
||||||
finished = p.waitForFinished(timeOutMS);
|
finished = p.state() == QProcess::NotRunning || p.waitForFinished(timeOutMS);
|
||||||
hasData = false;
|
hasData = false;
|
||||||
// First check 'stdout'
|
// First check 'stdout'
|
||||||
if (p.bytesAvailable()) { // applies to readChannel() only
|
if (p.bytesAvailable()) { // applies to readChannel() only
|
||||||
|
|||||||
Reference in New Issue
Block a user