From c1556392eb83475bde20c727a6002967a61cfb6b Mon Sep 17 00:00:00 2001 From: Christian Stenger Date: Fri, 9 Sep 2022 14:03:56 +0200 Subject: [PATCH] Squish: Avoid crash Due to high frequency of re-usage of the processes we may clash with the destruction of a formerly running process using the same QtcProcess object. Explicitly closing it before (re)starting cleanly destructs the former process. Change-Id: Id26e55ac3aaf5c24178d168c6391ae0c51139684 Reviewed-by: Jarek Kobus --- src/plugins/squish/squishtools.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/plugins/squish/squishtools.cpp b/src/plugins/squish/squishtools.cpp index a4f149b4b70..62fcc227d02 100644 --- a/src/plugins/squish/squishtools.cpp +++ b/src/plugins/squish/squishtools.cpp @@ -369,8 +369,12 @@ void SquishTools::startSquishServer(Request request) const QStringList arguments = serverArgumentsFromSettings(); m_serverProcess.setCommand({toolsSettings.serverPath, arguments}); + m_serverProcess.setEnvironment(squishEnvironment()); + // especially when writing server config we re-use the process fast and start the server + // several times and may crash as the process may not have been cleanly destructed yet + m_serverProcess.close(); setState(ServerStarting); m_serverProcess.start(); if (!m_serverProcess.waitForStarted()) {