forked from qt-creator/qt-creator
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:
@@ -186,7 +186,7 @@ void AbstractProcessStep::run(QFutureInterface<bool> &fi)
|
||||
return;
|
||||
}
|
||||
|
||||
m_futureInterface.reset(&fi);
|
||||
m_futureInterface = &fi;
|
||||
|
||||
m_process.reset(new Utils::QtcProcess());
|
||||
m_process->setUseCtrlCStub(Utils::HostOsInfo::isWindowsHost());
|
||||
@@ -222,8 +222,7 @@ void AbstractProcessStep::cleanUp()
|
||||
m_process.reset();
|
||||
|
||||
// Report result
|
||||
reportRunResult(*(m_futureInterface.get()), returnValue);
|
||||
m_futureInterface.reset();
|
||||
reportRunResult(*m_futureInterface, returnValue);
|
||||
}
|
||||
|
||||
/*!
|
||||
@@ -338,7 +337,7 @@ void AbstractProcessStep::stdError(const QString &line)
|
||||
|
||||
QFutureInterface<bool> *AbstractProcessStep::futureInterface() const
|
||||
{
|
||||
return m_futureInterface.get();
|
||||
return m_futureInterface;
|
||||
}
|
||||
|
||||
void AbstractProcessStep::checkForCancel()
|
||||
|
@@ -89,7 +89,7 @@ private:
|
||||
void outputAdded(const QString &string, BuildStep::OutputFormat format);
|
||||
|
||||
QTimer m_timer;
|
||||
std::unique_ptr<QFutureInterface<bool>> m_futureInterface;
|
||||
QFutureInterface<bool> *m_futureInterface;
|
||||
std::unique_ptr<Utils::QtcProcess> m_process;
|
||||
std::unique_ptr<IOutputParser> m_outputParserChain;
|
||||
ProcessParameters m_param;
|
||||
|
Reference in New Issue
Block a user