From 026476a61bc526a14606ac6acdf747c3aad9380c Mon Sep 17 00:00:00 2001 From: Christian Mollekopf Date: Sun, 20 May 2018 10:32:59 +0200 Subject: Actually close the lmdb environment before removing from disk. Otherwise removal doesn't work on windows due to open file handles. --- common/storage_lmdb.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/common/storage_lmdb.cpp b/common/storage_lmdb.cpp index ddb4f84..660326a 100644 --- a/common/storage_lmdb.cpp +++ b/common/storage_lmdb.cpp @@ -974,13 +974,12 @@ void DataStore::removeFromDisk() const QWriteLocker dbiLocker(&sDbisLock); QWriteLocker envLocker(&sEnvironmentsLock); SinkTrace() << "Removing database from disk: " << fullPath; - sEnvironments.take(fullPath); + auto env = sEnvironments.take(fullPath); for (const auto &key : sDbis.keys()) { if (key.startsWith(d->name)) { sDbis.remove(key); } } - auto env = sEnvironments.take(fullPath); mdb_env_close(env); QDir dir(fullPath); if (!dir.removeRecursively()) { -- cgit v1.2.3