CMake: Make sure to never trigger a timer on an destroyed object

This object might have gone out of scope by the time the timer hits.

Task-number: QTCREATORBUG-17289
Change-Id: I4b9ea75c9b4b1c905ece44965e80a5accc3590f3
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
This commit is contained in:
Tobias Hunger
2016-11-22 13:46:19 +01:00
parent 2d777a8082
commit 52fc4a4ebd

View File

@@ -112,7 +112,7 @@ ServerMode::ServerMode(const Environment &env,
m_cmakeProcess->setCommand(cmakeExecutable.toString(), argumentString);
// Delay start:
QTimer::singleShot(0, [argumentString, this] {
QTimer::singleShot(0, this, [argumentString, this] {
emit message(tr("Running \"%1 %2\" in %3.")
.arg(m_cmakeExecutable.toUserOutput())
.arg(argumentString)