From 0a5477c7e30667f4dc864b69975a8da5f63ca71e Mon Sep 17 00:00:00 2001 From: Cory Fields Date: Thu, 7 Sep 2017 14:26:20 -0400 Subject: 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: 2525b972af6645ca239ac1078cffb132b402bfbb --- src/init.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/init.cpp b/src/init.cpp index 62250664e3..798c24a2a8 100644 --- a/src/init.cpp +++ b/src/init.cpp @@ -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)) { -- cgit v1.2.3