From: Mohammed Sameer Date: Wed, 2 Jan 2013 00:44:58 +0000 (+0200) Subject: Delete QSparqlConnection when we are not active X-Git-Url: http://cgit.sxemacs.org/?a=commitdiff_plain;h=f7e88ff2f066c6ae73b0df7a0ed7c72315fbc479;p=harmattan%2Fcameraplus Delete QSparqlConnection when we are not active --- 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(); }