Unload user and network modules once all the clients are gone and we are disconencted from any IRC servers.

The OnIRCDisconnected module call would cause a segmentation fault
because it would try m_pNetwork->GetModules().GetNetwork(). GetModules()
would return NULL.
This commit is contained in:
Kyle Fuller
2011-08-31 01:14:18 +00:00
parent 75d7cdffd9
commit bf8b1624c9
2 changed files with 8 additions and 8 deletions
+4 -4
View File
@@ -134,10 +134,6 @@ CIRCNetwork::CIRCNetwork(CUser *pUser, const CIRCNetwork *pNetwork, bool bCloneC
}
CIRCNetwork::~CIRCNetwork() {
// Delete modules (this unloads all modules)
delete m_pModules;
m_pModules = NULL;
// Delete clients
for (vector<CClient*>::const_iterator it = m_vClients.begin(); it != m_vClients.end(); ++it) {
CZNC::Get().GetManager().DelSockByAddr(*it);
@@ -147,6 +143,10 @@ CIRCNetwork::~CIRCNetwork() {
// Delete servers
DelServers();
// Delete modules (this unloads all modules)
delete m_pModules;
m_pModules = NULL;
// Delete Channels
for (vector<CChan*>::const_iterator it = m_vChans.begin(); it != m_vChans.end(); ++it) {
delete *it;