diff --git a/YACReaderLibrary/db/folder_model.cpp b/YACReaderLibrary/db/folder_model.cpp index f454e599..1944e1e1 100644 --- a/YACReaderLibrary/db/folder_model.cpp +++ b/YACReaderLibrary/db/folder_model.cpp @@ -729,10 +729,13 @@ void FolderModelProxy::setupFilteredModelData() QLOG_ERROR() << "Unable to parse query: " << e.what(); } } - QSqlDatabase::removeDatabase(db.connectionName()); + + connectionName = db.connectionName(); endResetModel(); } + + QSqlDatabase::removeDatabase(connectionName); } void FolderModelProxy::clear()