forked from qt-creator/qt-creator
Fix up QProcess::waitForFinished()
waitForFinish returns false if the process is no longer running at the time of the call. Handle that throughout the codebase. Change-Id: Ia7194095454e82efbd4eb88f2d55926bdd09e094 Reviewed-by: hjk <hjk@theqtcompany.com>
This commit is contained in:
@@ -285,7 +285,7 @@ bool startCreatorAsDebugger(bool asClient, QString *errorMessage)
|
||||
// Short execution time: indicates that -client was passed on attach to
|
||||
// another running instance of Qt Creator. Keep alive as long as user
|
||||
// does not close the process. If that fails, try to launch 2nd instance.
|
||||
const bool waitResult = p.waitForFinished(-1);
|
||||
const bool waitResult = p.waitForFinished(-1) || p.state() == QProcess::NotRunning;
|
||||
const bool ranAsClient = asClient && (executionTime.elapsed() < 10000);
|
||||
if (waitResult && p.exitStatus() == QProcess::NormalExit && ranAsClient) {
|
||||
if (p.exitCode() == 0) {
|
||||
|
||||
Reference in New Issue
Block a user