Skip to content

Commit 0a5477c

Browse files
theuniMarcoFalke
authored andcommitted
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: 2525b97
1 parent b4136f2 commit 0a5477c

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
@@ -193,9 +193,13 @@ void Shutdown()
193193
}
194194
#endif
195195
MapPort(false);
196+
197+
// Because these depend on each-other, we make sure that neither can be
198+
// using the other before destroying them.
196199
UnregisterValidationInterface(peerLogic.get());
197-
g_connman.reset();
200+
g_connman->Stop();
198201
peerLogic.reset();
202+
g_connman.reset();
199203

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

0 commit comments

Comments
 (0)