aboutsummaryrefslogtreecommitdiff
path: root/src/wallet/wallet2.cpp
diff options
context:
space:
mode:
authorDusan Klinec <dusan.klinec@gmail.com>2021-07-13 14:42:19 +0200
committerDusan Klinec <dusan.klinec@gmail.com>2021-07-14 10:46:16 +0200
commit9c6e0941cb3bca0ba5a29f69c246586866204698 (patch)
treeaa79bca9fed509f41e08d9ee12c06fb3cda88154 /src/wallet/wallet2.cpp
parentMerge pull request #7764 (diff)
downloadmonero-9c6e0941cb3bca0ba5a29f69c246586866204698.tar.xz
fix #7784 - deinit wallet in wallet dtor
Diffstat (limited to '')
-rw-r--r--src/wallet/wallet2.cpp9
1 files changed, 6 insertions, 3 deletions
diff --git a/src/wallet/wallet2.cpp b/src/wallet/wallet2.cpp
index 05fe0a1ad..9e16c5166 100644
--- a/src/wallet/wallet2.cpp
+++ b/src/wallet/wallet2.cpp
@@ -1213,6 +1213,7 @@ wallet2::wallet2(network_type nettype, uint64_t kdf_rounds, bool unattended, std
wallet2::~wallet2()
{
+ deinit();
}
bool wallet2::has_testnet_option(const boost::program_options::variables_map& vm)
@@ -3745,9 +3746,11 @@ void wallet2::detach_blockchain(uint64_t height, std::map<std::pair<uint64_t, ui
//----------------------------------------------------------------------------------------------------
bool wallet2::deinit()
{
- m_is_initialized=false;
- unlock_keys_file();
- m_account.deinit();
+ if(m_is_initialized) {
+ m_is_initialized = false;
+ unlock_keys_file();
+ m_account.deinit();
+ }
return true;
}
//----------------------------------------------------------------------------------------------------