From 7dbdf3bb650d9ad89d90006ab95f8fa8071979a6 Mon Sep 17 00:00:00 2001 From: Thomas Frauendorfer Date: Fri, 16 Oct 2009 00:46:15 +0200 Subject: [PATCH] OTHER: Call disconnect from XClient destructor Make valgrind happy --- lib/xclient.cpp | 7 +++++++ lib/xclient.h | 1 + 2 files changed, 8 insertions(+) diff --git a/lib/xclient.cpp b/lib/xclient.cpp index 602682c..c7b2688 100644 --- a/lib/xclient.cpp +++ b/lib/xclient.cpp @@ -80,6 +80,13 @@ XClient::XClient (QObject *parent, const std::string &name) : QObject (parent), m_name = name; } +XClient::~XClient () +{ + // make sure we disconnect, to make valgrind happy + if (m_isconnected) + disconnect (); +} + void XClient::disconnect () { delete m_client; diff --git a/lib/xclient.h b/lib/xclient.h index da98ba7..60f2acd 100644 --- a/lib/xclient.h +++ b/lib/xclient.h @@ -43,6 +43,7 @@ class XClient : public QObject { Q_OBJECT public: XClient (QObject *, const std::string &); + ~XClient (); bool connect (const char *path = NULL, const bool &sync = false, QWidget* parent = NULL);