From f7e88ff2f066c6ae73b0df7a0ed7c72315fbc479 Mon Sep 17 00:00:00 2001 From: Mohammed Sameer Date: Wed, 2 Jan 2013 02:44:58 +0200 Subject: [PATCH] Delete QSparqlConnection when we are not active --- src/trackerstore.cpp | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/trackerstore.cpp b/src/trackerstore.cpp index 604627d..dc27993 100644 --- a/src/trackerstore.cpp +++ b/src/trackerstore.cpp @@ -58,7 +58,13 @@ void TrackerStore::setActive(bool active) { return; } - m_connection = new QSparqlConnection("QTRACKER_DIRECT", QSparqlConnectionOptions(), this); + if (active) { + m_connection = new QSparqlConnection("QTRACKER_DIRECT", QSparqlConnectionOptions(), this); + } + else { + m_connection->deleteLater(); + m_connection = 0; + } emit activeChanged(); } -- 2.34.1