QMake: Fix crash when canceling qmake run

Change-Id: I24d286210086bd85825b8fd300a69b4bb8778367
Reviewed-by: Tim Jenssen <tim.jenssen@theqtcompany.com>
This commit is contained in:
Tobias Hunger
2016-04-28 16:36:16 +02:00
parent 2f301bc45b
commit 4f76fdaded

View File

@@ -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;