AbstractProcessStep: Fix double-free of QFutureInterface

Partial revert of 732b832973

Change-Id: I22e1af3071b7345eae6459cfdfe5e3699f4ee804
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
This commit is contained in:
Tobias Hunger
2016-12-08 15:06:35 +01:00
parent 8b9c6ba4b3
commit 065f1562b3
2 changed files with 4 additions and 5 deletions

View File

@@ -186,7 +186,7 @@ void AbstractProcessStep::run(QFutureInterface<bool> &fi)
return; return;
} }
m_futureInterface.reset(&fi); m_futureInterface = &fi;
m_process.reset(new Utils::QtcProcess()); m_process.reset(new Utils::QtcProcess());
m_process->setUseCtrlCStub(Utils::HostOsInfo::isWindowsHost()); m_process->setUseCtrlCStub(Utils::HostOsInfo::isWindowsHost());
@@ -222,8 +222,7 @@ void AbstractProcessStep::cleanUp()
m_process.reset(); m_process.reset();
// Report result // Report result
reportRunResult(*(m_futureInterface.get()), returnValue); reportRunResult(*m_futureInterface, returnValue);
m_futureInterface.reset();
} }
/*! /*!
@@ -338,7 +337,7 @@ void AbstractProcessStep::stdError(const QString &line)
QFutureInterface<bool> *AbstractProcessStep::futureInterface() const QFutureInterface<bool> *AbstractProcessStep::futureInterface() const
{ {
return m_futureInterface.get(); return m_futureInterface;
} }
void AbstractProcessStep::checkForCancel() void AbstractProcessStep::checkForCancel()

View File

@@ -89,7 +89,7 @@ private:
void outputAdded(const QString &string, BuildStep::OutputFormat format); void outputAdded(const QString &string, BuildStep::OutputFormat format);
QTimer m_timer; QTimer m_timer;
std::unique_ptr<QFutureInterface<bool>> m_futureInterface; QFutureInterface<bool> *m_futureInterface;
std::unique_ptr<Utils::QtcProcess> m_process; std::unique_ptr<Utils::QtcProcess> m_process;
std::unique_ptr<IOutputParser> m_outputParserChain; std::unique_ptr<IOutputParser> m_outputParserChain;
ProcessParameters m_param; ProcessParameters m_param;