Skip to content

Commit

Permalink
GUI: When killing processes leave a message in log
Browse files Browse the repository at this point in the history
When ug process doesn't respond to termination GUI needs to kill it.
This makes the return code equal to 9 and GUI complains about a crash.
Without a message in the log this could have been confusing.
  • Loading branch information
mpiatka committed Jun 21, 2022
1 parent 4b5eaeb commit 08dc697
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion gui/QT/window/ultragrid_window.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -205,8 +205,10 @@ void UltragridWindow::outputAvailable(){
void UltragridWindow::start(){
if(process.processId() > 0){
process.terminate();
if(!process.waitForFinished(1000))
if(!process.waitForFinished(1000)){
log.write("UltraGrid process could not be terminated gracefully. Killing...\n");
process.kill();
}
return;
}

Expand Down Expand Up @@ -254,6 +256,7 @@ void UltragridWindow::stopPreview(){
* can be created. Here we wait 0.5s to allow the preview process
* exit gracefully. If it is still running after that we kill it */
if(!previewProcess.waitForFinished(500)){
log.write("Preview could not be terminated gracefully. Killing...\n");
previewProcess.kill();
}
}
Expand Down

0 comments on commit 08dc697

Please sign in to comment.