aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJoão Barbosa <joao.paulo.barbosa@gmail.com>2019-01-31 00:04:51 +0000
committerJoão Barbosa <joao.paulo.barbosa@gmail.com>2019-03-12 23:24:11 +0000
commit22cdb6cf590d61668c85c1c08dcc15b4e95921c6 (patch)
treebb43673e695f8d62fae7e33935b881ebb7cd305f
parentf20513bd71d0530ad9285b9558e3a02733250a63 (diff)
wallet: Close dbenv error file db.log
The error file db.log is opened by BerkeleyEnvironment instance and should be closed after dbenv is closed. Github-Pull: #15297 Rebased-From: 8602a1e
-rw-r--r--src/wallet/db.cpp5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/wallet/db.cpp b/src/wallet/db.cpp
index 408713c0c6..7e7fd24a8c 100644
--- a/src/wallet/db.cpp
+++ b/src/wallet/db.cpp
@@ -126,11 +126,16 @@ void BerkeleyEnvironment::Close()
}
}
+ FILE* error_file = nullptr;
+ dbenv->get_errfile(&error_file);
+
int ret = dbenv->close(0);
if (ret != 0)
LogPrintf("BerkeleyEnvironment::Close: Error %d closing database environment: %s\n", ret, DbEnv::strerror(ret));
if (!fMockDb)
DbEnv((u_int32_t)0).remove(strPath.c_str(), 0);
+
+ if (error_file) fclose(error_file);
}
void BerkeleyEnvironment::Reset()