mirror of
https://github.com/bitcoin/bitcoin.git
synced 2026-02-11 08:01:21 +00:00
Move BerkeleyEnvironment deletion from internal method to callsite
Instead of having the object destroy itself, having the caller destroy it. Github-Pull: #12493 Rebased-From: a769461
This commit is contained in:
parent
048fda2a66
commit
435df68c62
@ -724,7 +724,6 @@ void BerkeleyEnvironment::Flush(bool fShutdown)
|
||||
if (!fMockDb) {
|
||||
fs::remove_all(fs::path(strPath) / "database");
|
||||
}
|
||||
g_dbenvs.erase(strPath);
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -823,7 +822,11 @@ void BerkeleyDatabase::Flush(bool shutdown)
|
||||
{
|
||||
if (!IsDummy()) {
|
||||
env->Flush(shutdown);
|
||||
if (shutdown) env = nullptr;
|
||||
if (shutdown) {
|
||||
LOCK(cs_db);
|
||||
g_dbenvs.erase(env->Directory().string());
|
||||
env = nullptr;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user