Create unique database connections per thread and remove them using the database connection name from the QSqlDatabase instance being used.

This commit is contained in:
Luis Ángel San Martín
2018-04-24 20:53:24 +02:00
parent 0ff7da1d2c
commit 52c76d5482
7 changed files with 84 additions and 69 deletions

View File

@ -454,7 +454,7 @@ void ComicVineDialog::getComicsInfo(QList<QPair<ComicDB, QString> > & matchingIn
}
db.commit();
db.close();
QSqlDatabase::removeDatabase(databasePath);
QSqlDatabase::removeDatabase(db.connectionName());
close();
emit accepted();
@ -492,7 +492,7 @@ void ComicVineDialog::getComicInfo(const QString &comicId, int count, const QStr
db.commit();
db.close();
QSqlDatabase::removeDatabase(databasePath);
QSqlDatabase::removeDatabase(db.connectionName());
if(mode == SingleComic || currentIndex == (comics.count()-1))
{