net: stop both net/net_processing before destroying them

This should avoid either attempting to use an invalid reference/pointer to the
other.

Github-Pull: #10756
Rebased-From: 2525b972af
This commit is contained in:
Cory Fields 2017-09-07 14:26:20 -04:00 committed by MarcoFalke
parent b4136f21cf
commit 0a5477c7e3
1 changed files with 5 additions and 1 deletions

View File

@ -193,9 +193,13 @@ void Shutdown()
}
#endif
MapPort(false);
// Because these depend on each-other, we make sure that neither can be
// using the other before destroying them.
UnregisterValidationInterface(peerLogic.get());
g_connman.reset();
g_connman->Stop();
peerLogic.reset();
g_connman.reset();
StopTorControl();
if (fDumpMempoolLater && gArgs.GetArg("-persistmempool", DEFAULT_PERSIST_MEMPOOL)) {