diff options
author | Christian Mollekopf <chrigi_1@fastmail.fm> | 2015-01-16 13:26:42 +0100 |
---|---|---|
committer | Christian Mollekopf <chrigi_1@fastmail.fm> | 2015-01-16 13:26:42 +0100 |
commit | e56166cf75aff15eda05be5c33825bd926b9ccb2 (patch) | |
tree | f1f7a7b2c236a1a638bb97bcd864b0da661484b7 /common/storage_lmdb.cpp | |
parent | 0faf38f2ad9672fb46c77cae7317f44c72ebd10e (diff) | |
download | sink-e56166cf75aff15eda05be5c33825bd926b9ccb2.tar.gz sink-e56166cf75aff15eda05be5c33825bd926b9ccb2.zip |
Fixed storage removal.
We have to remove any open environments as well.
Diffstat (limited to 'common/storage_lmdb.cpp')
-rw-r--r-- | common/storage_lmdb.cpp | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/common/storage_lmdb.cpp b/common/storage_lmdb.cpp index 2dc4817..591d761 100644 --- a/common/storage_lmdb.cpp +++ b/common/storage_lmdb.cpp | |||
@@ -396,12 +396,14 @@ qint64 Storage::diskUsage() const | |||
396 | 396 | ||
397 | void Storage::removeFromDisk() const | 397 | void Storage::removeFromDisk() const |
398 | { | 398 | { |
399 | QDir dir(d->storageRoot + '/' + d->name); | 399 | const QString fullPath(d->storageRoot + '/' + d->name); |
400 | // dir.remove("data.mdb"); | 400 | QMutexLocker locker(&d->sMutex); |
401 | // dir.remove("lock.mdb"); | 401 | QDir dir(fullPath); |
402 | if (!dir.removeRecursively()) { | 402 | if (!dir.removeRecursively()) { |
403 | qWarning() << "Failed to remove directory" << d->storageRoot << d->name; | 403 | qWarning() << "Failed to remove directory" << d->storageRoot << d->name; |
404 | } | 404 | } |
405 | auto env = d->sEnvironments.take(fullPath); | ||
406 | delete env; | ||
405 | } | 407 | } |
406 | 408 | ||
407 | } // namespace Akonadi2 | 409 | } // namespace Akonadi2 |