mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-02-09 10:43:19 -05:00
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.
This commit is contained in:
parent
fd6d499bda
commit
0dd6a8c124
1 changed files with 3 additions and 1 deletions
|
@ -107,7 +107,9 @@ void RegisterValidationInterface(CValidationInterface* pwalletIn) {
|
||||||
}
|
}
|
||||||
|
|
||||||
void UnregisterValidationInterface(CValidationInterface* pwalletIn) {
|
void UnregisterValidationInterface(CValidationInterface* pwalletIn) {
|
||||||
|
if (g_signals.m_internals) {
|
||||||
g_signals.m_internals->m_connMainSignals.erase(pwalletIn);
|
g_signals.m_internals->m_connMainSignals.erase(pwalletIn);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void UnregisterAllValidationInterfaces() {
|
void UnregisterAllValidationInterfaces() {
|
||||||
|
|
Loading…
Add table
Reference in a new issue