Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nextcloud/desktop.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorMatthieu Gallien <matthieu.gallien@nextcloud.com>2022-01-17 20:54:38 +0300
committerMatthieu Gallien <matthieu.gallien@nextcloud.com>2022-01-19 14:01:20 +0300
commitde4b6e910cac0583013b655213d260411f0c1fa3 (patch)
tree79e8b049a9faa9673f8341009096eec8c6c9a283 /src
parent6c71efee1fd10548f2ea9bef2f4a38cff42f2073 (diff)
add missing locks in SyncJournalDb
Signed-off-by: Matthieu Gallien <matthieu.gallien@nextcloud.com>
Diffstat (limited to 'src')
-rw-r--r--src/common/syncjournaldb.cpp3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/common/syncjournaldb.cpp b/src/common/syncjournaldb.cpp
index 0b66a6cc0..ddd01be76 100644
--- a/src/common/syncjournaldb.cpp
+++ b/src/common/syncjournaldb.cpp
@@ -212,6 +212,8 @@ QString SyncJournalDb::databaseFilePath() const
// Then the next sync (and the SocketAPI) will have a faster access.
void SyncJournalDb::walCheckpoint()
{
+ QMutexLocker locker(&_mutex);
+
QElapsedTimer t;
t.start();
SqlQuery pragma1(_db);
@@ -1019,6 +1021,7 @@ qint64 SyncJournalDb::keyValueStoreGetInt(const QString &key, qint64 defaultValu
void SyncJournalDb::keyValueStoreDelete(const QString &key)
{
+ QMutexLocker locker(&_mutex);
const auto query = _queryManager.get(PreparedSqlQueryManager::DeleteKeyValueStoreQuery, QByteArrayLiteral("DELETE FROM key_value_store WHERE key=?1;"), _db);
if (!query) {
qCWarning(lcDb) << "Failed to initOrReset _deleteKeyValueStoreQuery";