Don't actually know if this is an actual issue or not, maybe not even leak in it, but a warning from Qt arrives when digikam starts: QSqlDatabasePrivate::removeDatabase: connection 'ConnectionTest' is still in use, all queries will cease to work. and it seems the Qt docs say to destroy the QSqlDatabase object before removing the connection: http://qt-project.org/doc/qt-4.7/qsqldatabase.html in removeConnection(). Actually not completely clear to me if it is necessary even though no query is open. I see in digikam code it is done differently. Reproducible: Always
Created attachment 88701 [details] Patch do free QSqlDatabase object before connection is removed.
Marcel, I need your feedback for this patch please. Gilles
Comment on attachment 88701 [details] Patch do free QSqlDatabase object before connection is removed. What is the actually changed code, indentation changes set aside?
A couple of brackets were added.
Luca, The 2 brackets add in void DatabaseConnectionChecker::run() must have no effect compared to previous implementation... Are you sure to have provided the right patch ? Gilles Caulier
I just checked again. The patch is what I intended. The effect of the brackets is to make the dtor of databaseHandler run before the connection is removed by QSqlDatabase::removeDatabase. Again, not sure this was strictly needed according to Qt sources as I don't see queries in the code, but the warning disappears.
Ok, I see. I have never understood why these error messages appear, but they never had any adverse effects. Patch is fine for me.
Git commit 7ef60a13291e421af23559462cfb41700bc70f60 by Gilles Caulier. Committed on 15/09/2014 at 20:41. Pushed by cgilles into branch 'master'. apply patch #88701 to prevent QtSQL plugin warnings FIXED-IN: 4.4.0 M +31 -29 app/database/databaseguierrorhandler.cpp M +1 -1 app/database/databaseguierrorhandler.h http://commits.kde.org/digikam/7ef60a13291e421af23559462cfb41700bc70f60