From a2e3f716a87a4a51f370709210591cdd82285a39 Mon Sep 17 00:00:00 2001 From: Tobias Hunger Date: Thu, 8 Dec 2016 15:06:51 +0100 Subject: [PATCH] QMake: Clean up Qmakestep Change-Id: I3a2baa4e15a48f99652cec6151803f20341e339a Reviewed-by: Tim Jenssen --- src/plugins/qmakeprojectmanager/qmakestep.cpp | 6 ++---- src/plugins/qmakeprojectmanager/qmakestep.h | 2 +- 2 files changed, 3 insertions(+), 5 deletions(-) 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