forked from qt-creator/qt-creator
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:
@@ -369,8 +369,12 @@ void SquishTools::startSquishServer(Request request)
|
|||||||
|
|
||||||
const QStringList arguments = serverArgumentsFromSettings();
|
const QStringList arguments = serverArgumentsFromSettings();
|
||||||
m_serverProcess.setCommand({toolsSettings.serverPath, arguments});
|
m_serverProcess.setCommand({toolsSettings.serverPath, arguments});
|
||||||
|
|
||||||
m_serverProcess.setEnvironment(squishEnvironment());
|
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);
|
setState(ServerStarting);
|
||||||
m_serverProcess.start();
|
m_serverProcess.start();
|
||||||
if (!m_serverProcess.waitForStarted()) {
|
if (!m_serverProcess.waitForStarted()) {
|
||||||
|
|||||||
Reference in New Issue
Block a user