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
@@ -88,10 +88,6 @@ CUser::CUser(const CString& sUserName)
}
CUser::~CUser() {
// Delete modules (unloads all modules!)
delete m_pModules;
m_pModules = NULL;
// Delete networks
for (unsigned int c = 0; c < m_vIRCNetworks.size(); c++) {
CIRCNetwork* pNetwork = m_vIRCNetworks[c];
@@ -106,6 +102,10 @@ CUser::~CUser() {
}
m_vClients.clear();
// Delete modules (unloads all modules!)
delete m_pModules;
m_pModules = NULL;
CZNC::Get().GetManager().DelCronByAddr(m_pUserTimer);
CZNC::Get().AddBytesRead(BytesRead());