From 46db545a90c549a4b9fd091a46dc4063b7e4154e Mon Sep 17 00:00:00 2001 From: Jarek Kobus Date: Fri, 17 Dec 2021 16:13:03 +0100 Subject: [PATCH] Install LocalAddressFinder also as stop dependency The LocalAddressFinder was installed as a start dependency for MemcheckToolRunner. However, it wasn't registered as stop dependency for it. This means that when MemcheckToolRunner was finished, its RunControl couldn't finish as one of its RunWorkers wasn't finished yet. Install LocalAddressFinder as a stop dependency and implement a stop() method which disconnects the conneciton. This also prevents the ApplicationOutput pane to open a new tab on successive run of Memcheck for the same application. Fixes: QTCREATORBUG-26758 Change-Id: Ib71ddbe787e5c1bcc7b96687ebf15c9b63b714dc Reviewed-by: hjk --- src/plugins/valgrind/memchecktool.cpp | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/src/plugins/valgrind/memchecktool.cpp b/src/plugins/valgrind/memchecktool.cpp index ff97b153b6f..17455b6708b 100644 --- a/src/plugins/valgrind/memchecktool.cpp +++ b/src/plugins/valgrind/memchecktool.cpp @@ -166,6 +166,12 @@ public: connection.connectToHost(); } + void stop() override + { + connection.disconnectFromHost(); + reportStopped(); + } + QSsh::SshConnection connection; }; @@ -1170,8 +1176,11 @@ MemcheckToolRunner::MemcheckToolRunner(RunControl *runControl) } // We need a real address to connect to from the outside. - if (device()->type() != ProjectExplorer::Constants::DESKTOP_DEVICE_TYPE) - addStartDependency(new LocalAddressFinder(runControl, &m_localServerAddress)); + if (device()->type() != ProjectExplorer::Constants::DESKTOP_DEVICE_TYPE) { + auto *dependentWorker = new LocalAddressFinder(runControl, &m_localServerAddress); + addStartDependency(dependentWorker); + addStopDependency(dependentWorker); + } dd->setupRunner(this); }