aboutsummaryrefslogtreecommitdiff
path: root/src/wallet/wallet2.cpp
diff options
context:
space:
mode:
authorluigi1111 <luigi1111w@gmail.com>2021-08-11 22:30:11 -0400
committerluigi1111 <luigi1111w@gmail.com>2021-08-11 22:30:11 -0400
commit62844a776ddad0ab6410e99985709c5c6ef5642e (patch)
tree302ce86a6e6972cfe0236a2ba6ac98854b672848 /src/wallet/wallet2.cpp
parentMerge pull request #7796 (diff)
parentfix #7784 - deinit wallet in wallet dtor (diff)
downloadmonero-62844a776ddad0ab6410e99985709c5c6ef5642e.tar.xz
Merge pull request #7786
9c6e094 fix #7784 - deinit wallet in wallet dtor (Dusan Klinec)
Diffstat (limited to 'src/wallet/wallet2.cpp')
-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 721a7faf8..217a22027 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)
@@ -3748,9 +3749,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;
}
//----------------------------------------------------------------------------------------------------