Skip to content

Commit ecdb75a

Browse files
committed
Shutdown process: verify peerLogic and g_connman existence before try to accessing them.
Plus added a missing g_connman stop.
1 parent b5b9f99 commit ecdb75a

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/init.cpp

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -232,7 +232,10 @@ void PrepareShutdown()
232232
#endif
233233
StopMapPort();
234234

235-
UnregisterValidationInterface(peerLogic.get());
235+
// Because these depend on each-other, we make sure that neither can be
236+
// using the other before destroying them.
237+
if (peerLogic) UnregisterValidationInterface(peerLogic.get());
238+
if (g_connman) g_connman->Stop();
236239
peerLogic.reset();
237240
g_connman.reset();
238241

0 commit comments

Comments
 (0)