mirror of
https://github.com/znc/znc.git
synced 2026-08-07 17:33:34 +02:00
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:
@@ -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());
|
||||
|
||||
Reference in New Issue
Block a user