Destroy the CIRCSock for a network when the CIRCNetwork is destroyed

This commit is contained in:
Kyle Fuller
2011-09-05 20:16:10 +00:00
parent 8945fbeb48
commit 855e0778ac
2 changed files with 5 additions and 11 deletions

View File

@@ -134,6 +134,11 @@ CIRCNetwork::CIRCNetwork(CUser *pUser, const CIRCNetwork *pNetwork, bool bCloneC
}
CIRCNetwork::~CIRCNetwork() {
if (m_pIRCSock) {
CZNC::Get().GetManager().DelSockByAddr(m_pIRCSock);
m_pIRCSock = NULL;
}
// Delete clients
for (vector<CClient*>::const_iterator it = m_vClients.begin(); it != m_vClients.end(); ++it) {
CZNC::Get().GetManager().DelSockByAddr(*it);