mirror of
https://github.com/znc/znc.git
synced 2026-07-03 00:11:59 +02:00
Fix a memory leak/crash in CModule
CModule::RemTimer(CTimer* pTimer) only removed the timer from CModule's own list of timers but didn't actually destroy the timer. This meant that the timer could continue to run after it was supposed to be deleted. Because CModule's destructor used this function this means that all timers active when a module is unloaded where leaked. When these timers where then later destroyed this caused a crash because their vtable points inside the module which was already unloaded (not good!). Thanks to KiNgMaR for finding and reporting this crash bug. git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1650 726aef4b-f618-498e-8847-2d620e286838
This commit is contained in:
@@ -328,6 +328,7 @@ bool CModule::AddTimer(FPTimer_t pFBCallback, const CString& sLabel, u_int uInte
|
||||
bool CModule::RemTimer(CTimer* pTimer) {
|
||||
if (m_sTimers.erase(pTimer) == 0)
|
||||
return false;
|
||||
m_pManager->DelCronByAddr(pTimer);
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user