Browse Source

net: only delete CConnman if it's been created

In the case of (for example) an already-running bitcoind, the shutdown sequence
begins before CConnman has been created, leading to a null-pointer dereference
when g_connman->Stop() is called.

Instead, Just let the CConnman dtor take care of stopping.
0.14
Cory Fields 8 years ago
parent
commit
36fa01f217
  1. 1
      src/init.cpp
  2. 1
      src/net.cpp

1
src/init.cpp

@ -200,7 +200,6 @@ void Shutdown()
pwalletMain->Flush(false); pwalletMain->Flush(false);
#endif #endif
MapPort(false); MapPort(false);
g_connman->Stop();
g_connman.reset(); g_connman.reset();
StopTorControl(); StopTorControl();

1
src/net.cpp

@ -2205,6 +2205,7 @@ void CConnman::DeleteNode(CNode* pnode)
CConnman::~CConnman() CConnman::~CConnman()
{ {
Stop();
} }
size_t CConnman::GetAddressCount() const size_t CConnman::GetAddressCount() const

Loading…
Cancel
Save