mirror of
https://github.com/znc/znc.git
synced 2026-08-09 18:32:55 +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:
+4
-4
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user