From eed38ff5c36a4d488a7282b56778a86e7e18a34e Mon Sep 17 00:00:00 2001 From: Ken Moore Date: Mon, 12 Oct 2015 08:53:14 -0400 Subject: Add a process verification check to the LuminaUtils functions for running external utilities. This should catch/break the loop if the external utility stops in some strange way. --- libLumina/LuminaUtils.cpp | 2 ++ 1 file changed, 2 insertions(+) (limited to 'libLumina/LuminaUtils.cpp') diff --git a/libLumina/LuminaUtils.cpp b/libLumina/LuminaUtils.cpp index 9a09ddf9..27083611 100644 --- a/libLumina/LuminaUtils.cpp +++ b/libLumina/LuminaUtils.cpp @@ -38,6 +38,7 @@ int LUtils::runCmd(QString cmd, QStringList args){ } if(!proc.waitForStarted(30000)){ return 1; } //process never started - max wait of 30 seconds while(!proc.waitForFinished(300)){ + if(proc.state() != QProcess::Running){ break; } //somehow missed the finished signal QCoreApplication::processEvents(); } int ret = proc.exitCode(); @@ -59,6 +60,7 @@ QStringList LUtils::getCmdOutput(QString cmd, QStringList args){ } if(!proc.waitForStarted(30000)){ return QStringList(); } //process never started - max wait of 30 seconds while(!proc.waitForFinished(500)){ + if(proc.state() != QProcess::Running){ break; } //somehow missed the finished signal QCoreApplication::processEvents(); } QStringList out = QString(proc.readAllStandardOutput()).split("\n"); -- cgit