mirror of
https://github.com/YACReader/yacreader
synced 2025-07-19 05:24:57 -04:00
Fix object leaks in database code
Qt's database and query model requires that both the queries and the database objects are out of scope before a database connection can safely be removed. Solution: Properly encapsulate databases and queries in "{ }" and use a string to cache the connection name for out-of-scope removal.
This commit is contained in:
@ -150,8 +150,7 @@ private:
|
||||
QList<ComicItem *> _data;
|
||||
|
||||
QString _databasePath;
|
||||
|
||||
QSqlDatabase dbTransaction;
|
||||
QString _databaseConnection;
|
||||
|
||||
bool enableResorting;
|
||||
Mode mode;
|
||||
|
Reference in New Issue
Block a user