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 <jaroslaw.kobus@qt.io>
This commit is contained in:
Christian Stenger
2022-09-09 14:03:56 +02:00
parent c94382aea5
commit c1556392eb

View File

@@ -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()) {