diff options
author | João Barbosa <joao.paulo.barbosa@gmail.com> | 2019-01-29 01:08:30 +0000 |
---|---|---|
committer | João Barbosa <joao.paulo.barbosa@gmail.com> | 2019-02-03 22:23:44 +0000 |
commit | 0dd6a8c12489ea4428b398a2328dde5d1a9fe39b (patch) | |
tree | f73cae4bb143a18ab0ac1854328a47ade2a62a42 /src | |
parent | fd6d499bdacfa29f25b0f675375e3feaced08667 (diff) |
Check m_internals in UnregisterValidationInterface
When a wallet is created it is registered in the validation interface (in
CWallet::CreateWalletFromFile) but it is not immediately added to the
wallets list. If a shutdown is requested before AddWallet (case more
evident when -rescan is set) then m_internals can be released (in
Shutdown -> UnregisterBackgroundSignalScheduler) before the wallet and
then ReleaseWallet would call UnregisterValidationInterface with
m_internals already released.
Diffstat (limited to 'src')
-rw-r--r-- | src/validationinterface.cpp | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/validationinterface.cpp b/src/validationinterface.cpp index 2e13bef19e..70c274d20e 100644 --- a/src/validationinterface.cpp +++ b/src/validationinterface.cpp @@ -107,7 +107,9 @@ void RegisterValidationInterface(CValidationInterface* pwalletIn) { } void UnregisterValidationInterface(CValidationInterface* pwalletIn) { - g_signals.m_internals->m_connMainSignals.erase(pwalletIn); + if (g_signals.m_internals) { + g_signals.m_internals->m_connMainSignals.erase(pwalletIn); + } } void UnregisterAllValidationInterfaces() { |