net: stop both net/net_processing before destroying them

This should avoid either attempting to use an invalid reference/pointer to the
other.
This commit is contained in:
Cory Fields 2017-09-07 14:26:20 -04:00
parent 80e2e9d0ce
commit 2525b972af
1 changed files with 5 additions and 1 deletions

View File

@ -194,9 +194,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)) {