Merge pull request #4853

2b3595d0 various: do not propagate exception through dtor (moneromooo-monero)
This commit is contained in:
Riccardo Spagni 2018-12-04 17:07:51 +02:00
commit 398f7076bb
No known key found for this signature in database
GPG key ID: 55432DF31CCD4FCD
4 changed files with 11 additions and 4 deletions

View file

@ -55,7 +55,8 @@ public:
{
if (m_ok)
{
mp_http_client->disconnect();
try { mp_http_client->disconnect(); }
catch (...) { /* do not propagate through dtor */ }
}
}

View file

@ -830,7 +830,12 @@ wallet_keys_unlocker::~wallet_keys_unlocker()
{
if (!locked)
return;
w.encrypt_keys(key);
try { w.encrypt_keys(key); }
catch (...)
{
MERROR("Failed to re-encrypt wallet keys");
// do not propagate through dtor, we'd crash
}
}
wallet2::wallet2(network_type nettype, uint64_t kdf_rounds, bool unattended):