From 08dc6972678855a15b90f24573d9f4299d130666 Mon Sep 17 00:00:00 2001 From: Martin Piatka Date: Mon, 6 Jun 2022 14:48:42 +0200 Subject: [PATCH] GUI: When killing processes leave a message in log 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. --- gui/QT/window/ultragrid_window.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/gui/QT/window/ultragrid_window.cpp b/gui/QT/window/ultragrid_window.cpp index d4b10039d..b433a73c3 100644 --- a/gui/QT/window/ultragrid_window.cpp +++ b/gui/QT/window/ultragrid_window.cpp @@ -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; } @@ -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(); } }