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)) {