Browse Source

net: stop both net/net_processing before destroying them

This should avoid either attempting to use an invalid reference/pointer to the
other.
0.16
Cory Fields 7 years ago
parent
commit
2525b972af
  1. 6
      src/init.cpp

6
src/init.cpp

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

Loading…
Cancel
Save