From 62e3280048e70eb04f7b4857fa3d62657a7ad7c7 Mon Sep 17 00:00:00 2001 From: Ivailo Monev Date: Sun, 12 May 2024 12:01:05 +0300 Subject: [PATCH] plasma: disengage the sensor manager in system-monitor applet KSGRD::SensorMgr does not do it automatically Signed-off-by: Ivailo Monev --- plasma/applets/system-monitor/system-monitor.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/plasma/applets/system-monitor/system-monitor.cpp b/plasma/applets/system-monitor/system-monitor.cpp index 3febfd89..192bc950 100644 --- a/plasma/applets/system-monitor/system-monitor.cpp +++ b/plasma/applets/system-monitor/system-monitor.cpp @@ -373,6 +373,7 @@ class SystemMonitorClient : public QObject, public KSGRD::SensorClient Q_OBJECT public: SystemMonitorClient(QObject *parent); + ~SystemMonitorClient(); bool setup(const QString &hostname, const int port); QList sensors() const; @@ -402,6 +403,13 @@ SystemMonitorClient::SystemMonitorClient(QObject *parent) connect(KSGRD::SensorMgr, SIGNAL(update()), this, SLOT(slotUpdate())); } +SystemMonitorClient::~SystemMonitorClient() +{ + if (KSGRD::SensorMgr->isConnected(m_hostname)) { + KSGRD::SensorMgr->disengage(m_hostname); + } +} + bool SystemMonitorClient::setup(const QString &hostname, const int port) { if (KSGRD::SensorMgr->isConnected(m_hostname)) {