diff --git a/src/plugins/qmakeprojectmanager/qmakestep.cpp b/src/plugins/qmakeprojectmanager/qmakestep.cpp index 19d69766065..f58f9b79e4f 100644 --- a/src/plugins/qmakeprojectmanager/qmakestep.cpp +++ b/src/plugins/qmakeprojectmanager/qmakestep.cpp @@ -336,8 +336,7 @@ void QMakeStep::startOneCommand(const QString &command, const QString &args) pp->resolveAll(); QTC_ASSERT(!m_commandFuture || m_commandFuture->future().isFinished(), return); - delete m_commandFuture; - m_commandFuture = new QFutureInterface; + m_commandFuture.reset(new QFutureInterface); m_commandWatcher.setFuture(m_commandFuture->future()); AbstractProcessStep::run(*m_commandFuture); @@ -355,8 +354,7 @@ void QMakeStep::runNextCommand() wasSuccess = false; // should not happen } - delete m_commandFuture; - m_commandFuture = nullptr; + m_commandFuture.reset(); if (!wasSuccess) m_nextState = State::POST_PROCESS; diff --git a/src/plugins/qmakeprojectmanager/qmakestep.h b/src/plugins/qmakeprojectmanager/qmakestep.h index bc1d969ca68..237e48bb0f5 100644 --- a/src/plugins/qmakeprojectmanager/qmakestep.h +++ b/src/plugins/qmakeprojectmanager/qmakestep.h @@ -177,7 +177,7 @@ private: QFutureInterface m_inputFuture; QFutureWatcher m_inputWatcher; - QFutureInterface *m_commandFuture = nullptr; + std::unique_ptr> m_commandFuture; QFutureWatcher m_commandWatcher; // last values