diff options
| author | João Barbosa <[email protected]> | 2018-06-04 23:15:03 +0100 |
|---|---|---|
| committer | João Barbosa <[email protected]> | 2018-06-18 16:35:39 +0100 |
| commit | 0b82bac76d0f842bd2294a290388536951fbc576 (patch) | |
| tree | 4806c11e461ddfd1e33ad64728a3b70b3a465339 /src | |
| parent | ui: Support wallets unloaded dynamically (diff) | |
| download | discoin-0b82bac76d0f842bd2294a290388536951fbc576.tar.xz discoin-0b82bac76d0f842bd2294a290388536951fbc576.zip | |
bugfix: Remove dangling wallet env instance
Diffstat (limited to 'src')
| -rw-r--r-- | src/wallet/db.cpp | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/src/wallet/db.cpp b/src/wallet/db.cpp index 410dd5009..01b8eaccc 100644 --- a/src/wallet/db.cpp +++ b/src/wallet/db.cpp @@ -694,8 +694,10 @@ void BerkeleyEnvironment::Flush(bool fShutdown) if (mapFileUseCount.empty()) { dbenv->log_archive(&listp, DB_ARCH_REMOVE); Close(); - if (!fMockDb) + if (!fMockDb) { fs::remove_all(fs::path(strPath) / "database"); + } + g_dbenvs.erase(strPath); } } } @@ -794,5 +796,6 @@ void BerkeleyDatabase::Flush(bool shutdown) { if (!IsDummy()) { env->Flush(shutdown); + if (shutdown) env = nullptr; } } |