From 4f76fdaded73ede7052b57d759570b68b69c17e1 Mon Sep 17 00:00:00 2001 From: Tobias Hunger Date: Thu, 28 Apr 2016 16:36:16 +0200 Subject: [PATCH] QMake: Fix crash when canceling qmake run Change-Id: I24d286210086bd85825b8fd300a69b4bb8778367 Reviewed-by: Tim Jenssen --- src/plugins/qmakeprojectmanager/qmakestep.cpp | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/plugins/qmakeprojectmanager/qmakestep.cpp b/src/plugins/qmakeprojectmanager/qmakestep.cpp index ae94d872243..76eca0b6652 100644 --- a/src/plugins/qmakeprojectmanager/qmakestep.cpp +++ b/src/plugins/qmakeprojectmanager/qmakestep.cpp @@ -342,7 +342,15 @@ void QMakeStep::startOneCommand(const QString &command, const QString &args) void QMakeStep::runNextCommand() { - bool wasSuccess = m_commandFuture ? m_commandFuture->future().result() : true; + bool wasSuccess = true; + if (m_commandFuture) { + if (m_commandFuture->isCanceled()) + wasSuccess = false; + else if (m_commandFuture->isFinished()) + wasSuccess = m_commandFuture->future().result(); + else + wasSuccess = false; // should not happen + } delete m_commandFuture; m_commandFuture = nullptr;