1
0
mirror of https://github.com/clementine-player/Clementine synced 2024-12-17 20:09:50 +01:00

Mutex-lock DB to avoid concurrent access while doing backup DB, as it will be actually locked the DB, and what make Clementine stop if we try to modify it (e.g. add a new playlist)

This commit is contained in:
Arnaud Bienner 2012-05-20 21:54:17 +02:00
parent 25666f1395
commit 4caa3fc17e

View File

@ -719,6 +719,7 @@ void Database::DoBackup() {
QSqlDatabase db(this->Connect()); QSqlDatabase db(this->Connect());
// Before we overwrite anything, make sure the database is not corrupt // Before we overwrite anything, make sure the database is not corrupt
QMutexLocker l(&mutex_);
const bool ok = IntegrityCheck(db); const bool ok = IntegrityCheck(db);
if (ok) { if (ok) {