diff --git a/src/plugins/valgrind/valgrindengine.cpp b/src/plugins/valgrind/valgrindengine.cpp index a6a21e7dcb5..a1b2b9cd35e 100644 --- a/src/plugins/valgrind/valgrindengine.cpp +++ b/src/plugins/valgrind/valgrindengine.cpp @@ -61,6 +61,17 @@ ValgrindToolRunner::ValgrindToolRunner(RunControl *runControl) setSupportsReRunning(false); m_settings.fromMap(runControl->settingsData(ANALYZER_VALGRIND_SETTINGS)); + + connect(&m_runner, &ValgrindRunner::processOutputReceived, + this, &ValgrindToolRunner::receiveProcessOutput); + connect(&m_runner, &ValgrindRunner::valgrindExecuted, + this, [this](const QString &commandLine) { + appendMessage(commandLine, NormalMessageFormat); + }); + connect(&m_runner, &ValgrindRunner::processErrorReceived, + this, &ValgrindToolRunner::receiveProcessError); + connect(&m_runner, &ValgrindRunner::finished, + this, &ValgrindToolRunner::runnerFinished); } void ValgrindToolRunner::start() @@ -96,17 +107,6 @@ void ValgrindToolRunner::start() if (auto aspect = runControl()->aspect()) m_runner.setUseTerminal(aspect->useTerminal); - connect(&m_runner, &ValgrindRunner::processOutputReceived, - this, &ValgrindToolRunner::receiveProcessOutput); - connect(&m_runner, &ValgrindRunner::valgrindExecuted, - this, [this](const QString &commandLine) { - appendMessage(commandLine, NormalMessageFormat); - }); - connect(&m_runner, &ValgrindRunner::processErrorReceived, - this, &ValgrindToolRunner::receiveProcessError); - connect(&m_runner, &ValgrindRunner::finished, - this, &ValgrindToolRunner::runnerFinished); - if (!m_runner.start()) { m_progress.cancel(); reportFailure(); @@ -161,11 +161,6 @@ void ValgrindToolRunner::runnerFinished() m_progress.reportFinished(); - disconnect(&m_runner, &ValgrindRunner::processOutputReceived, - this, &ValgrindToolRunner::receiveProcessOutput); - disconnect(&m_runner, &ValgrindRunner::finished, - this, &ValgrindToolRunner::runnerFinished); - reportStopped(); }