Skip to content

Commit 2525b97

Browse files
committed
net: stop both net/net_processing before destroying them
This should avoid either attempting to use an invalid reference/pointer to the other.
1 parent 80e2e9d commit 2525b97

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/init.cpp

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -194,9 +194,13 @@ void Shutdown()
194194
}
195195
#endif
196196
MapPort(false);
197+
198+
// Because these depend on each-other, we make sure that neither can be
199+
// using the other before destroying them.
197200
UnregisterValidationInterface(peerLogic.get());
198-
g_connman.reset();
201+
g_connman->Stop();
199202
peerLogic.reset();
203+
g_connman.reset();
200204

201205
StopTorControl();
202206
if (fDumpMempoolLater && gArgs.GetArg("-persistmempool", DEFAULT_PERSIST_MEMPOOL)) {

0 commit comments

Comments
 (0)