mirror of
https://github.com/bitcoin/bitcoin.git
synced 2026-01-19 06:43:45 +01:00
Fix shutdown in case of errors during initialization
PR #10286 introduced a few steps which are not robust to early shutdown in initialization. Stumbled upon this with #11781, not sure if there are other scenarios that can trigger it, but it's harden against this in any case.
This commit is contained in:
@@ -193,8 +193,8 @@ void Shutdown()
|
||||
|
||||
// Because these depend on each-other, we make sure that neither can be
|
||||
// using the other before destroying them.
|
||||
UnregisterValidationInterface(peerLogic.get());
|
||||
if(g_connman) g_connman->Stop();
|
||||
if (peerLogic) UnregisterValidationInterface(peerLogic.get());
|
||||
if (g_connman) g_connman->Stop();
|
||||
peerLogic.reset();
|
||||
g_connman.reset();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user