diff options
| author | Cory Fields <[email protected]> | 2017-09-07 14:26:20 -0400 |
|---|---|---|
| committer | Cory Fields <[email protected]> | 2017-09-07 14:26:23 -0400 |
| commit | 2525b972af6645ca239ac1078cffb132b402bfbb (patch) | |
| tree | 40e39b0d9258c870f3c32e18ce708a484da9b6c3 /src/init.cpp | |
| parent | net: drop unused connman param (diff) | |
| download | discoin-2525b972af6645ca239ac1078cffb132b402bfbb.tar.xz discoin-2525b972af6645ca239ac1078cffb132b402bfbb.zip | |
net: stop both net/net_processing before destroying them
This should avoid either attempting to use an invalid reference/pointer to the
other.
Diffstat (limited to 'src/init.cpp')
| -rw-r--r-- | src/init.cpp | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/src/init.cpp b/src/init.cpp index 9e8029971..810368b9d 100644 --- a/src/init.cpp +++ b/src/init.cpp @@ -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)) { |