mirror of
https://github.com/znc/znc.git
synced 2026-03-28 17:42:41 +01:00
Fix use-after-free which may happen during shutdown
If a module, e.g. keepnick, tries to remove a timer in OnIRCDisconnected. Thanks to KindOne for the report.
This commit is contained in:
@@ -121,7 +121,7 @@ public:
|
||||
return;
|
||||
|
||||
m_pTimer->Stop();
|
||||
RemTimer(m_pTimer->GetName());
|
||||
RemTimer(m_pTimer);
|
||||
m_pTimer = NULL;
|
||||
}
|
||||
|
||||
|
||||
@@ -51,6 +51,11 @@ CZNC::~CZNC() {
|
||||
|
||||
for (map<CString,CUser*>::iterator a = m_msUsers.begin(); a != m_msUsers.end(); ++a) {
|
||||
a->second->GetModules().UnloadAll();
|
||||
|
||||
const vector<CIRCNetwork*>& networks = a->second->GetNetworks();
|
||||
for (vector<CIRCNetwork*>::const_iterator b = networks.begin(); b != networks.end(); ++b) {
|
||||
(*b)->GetModules().UnloadAll();
|
||||
}
|
||||
}
|
||||
|
||||
for (size_t b = 0; b < m_vpListeners.size(); b++) {
|
||||
|
||||
Reference in New Issue
Block a user