summaryrefslogtreecommitdiffstats
path: root/app/lightmediascanner.cpp
diff options
context:
space:
mode:
authorMatt Ranostay <matt.ranostay@konsulko.com>2017-04-21 17:23:30 -0700
committerMatt Ranostay <matt.ranostay@konsulko.com>2017-04-21 17:29:45 -0700
commitc9f1c84b30076d2750c73364870a9b5884a183bd (patch)
treecfe313e856e342e106483c38e8f7f9ed97b8e05b /app/lightmediascanner.cpp
parent3bf175c871cac7d6b60d8263196262ea5ffcda74 (diff)
lightmediascanner: correctly disconnect database connection
To avoid the following message, the SQL connection needs to be probably : QSqlDatabasePrivate::addDatabase: duplicate connection name 'qt_sql_default_connection', old connection removed. Bug-AGL: SPEC-483 Change-Id: I8bc82503156c4b8f58ae8ecc9c186388106ddd00 Signed-off-by: Matt Ranostay <matt.ranostay@konsulko.com>
Diffstat (limited to 'app/lightmediascanner.cpp')
-rw-r--r--app/lightmediascanner.cpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/app/lightmediascanner.cpp b/app/lightmediascanner.cpp
index c17e0dc..7081f50 100644
--- a/app/lightmediascanner.cpp
+++ b/app/lightmediascanner.cpp
@@ -31,6 +31,12 @@ LightMediaScanner::LightMediaScanner(const QString& path)
}
}
+LightMediaScanner::~LightMediaScanner()
+{
+ lms.close();
+ QSqlDatabase::removeDatabase(lms.connectionName());
+}
+
bool LightMediaScanner::next(QString& item)
{
if (!query.next())