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.
This commit is contained in:
parent
64127b3098
commit
8602a1e6ae
1 changed files with 5 additions and 0 deletions
|
@ -126,11 +126,16 @@ void BerkeleyEnvironment::Close()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
FILE* error_file = nullptr;
|
||||||
|
dbenv->get_errfile(&error_file);
|
||||||
|
|
||||||
int ret = dbenv->close(0);
|
int ret = dbenv->close(0);
|
||||||
if (ret != 0)
|
if (ret != 0)
|
||||||
LogPrintf("BerkeleyEnvironment::Close: Error %d closing database environment: %s\n", ret, DbEnv::strerror(ret));
|
LogPrintf("BerkeleyEnvironment::Close: Error %d closing database environment: %s\n", ret, DbEnv::strerror(ret));
|
||||||
if (!fMockDb)
|
if (!fMockDb)
|
||||||
DbEnv((u_int32_t)0).remove(strPath.c_str(), 0);
|
DbEnv((u_int32_t)0).remove(strPath.c_str(), 0);
|
||||||
|
|
||||||
|
if (error_file) fclose(error_file);
|
||||||
}
|
}
|
||||||
|
|
||||||
void BerkeleyEnvironment::Reset()
|
void BerkeleyEnvironment::Reset()
|
||||||
|
|
Loading…
Reference in a new issue