mirror of
https://github.com/znc/znc.git
synced 2026-05-01 02:52:30 +02:00
Keep track of the timers and delete them upon destruction
git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@407 726aef4b-f618-498e-8847-2d620e286838
This commit is contained in:
9
User.cpp
9
User.cpp
@@ -28,8 +28,10 @@ CUser::CUser(const CString& sUserName, CZNC* pZNC) {
|
||||
m_sStatusPrefix = "*";
|
||||
m_uBufferCount = 50;
|
||||
m_bKeepBuffer = false;
|
||||
m_pZNC->GetManager().AddCron(new CKeepNickTimer(this));
|
||||
m_pZNC->GetManager().AddCron(new CJoinTimer(this));
|
||||
m_pKeepNickTimer = new CKeepNickTimer(this);
|
||||
m_pJoinTimer = new CJoinTimer(this);
|
||||
m_pZNC->GetManager().AddCron(m_pKeepNickTimer);
|
||||
m_pZNC->GetManager().AddCron(m_pJoinTimer);
|
||||
m_sUserPath = m_pZNC->GetUserPath() + "/" + sUserName;
|
||||
m_sDLPath = GetUserPath() + "/downloads";
|
||||
}
|
||||
@@ -45,6 +47,9 @@ CUser::~CUser() {
|
||||
for (unsigned int b = 0; b < m_vChans.size(); b++) {
|
||||
delete m_vChans[b];
|
||||
}
|
||||
|
||||
m_pZNC->GetManager().DelCronByAddr(m_pKeepNickTimer);
|
||||
m_pZNC->GetManager().DelCronByAddr(m_pJoinTimer);
|
||||
}
|
||||
|
||||
bool CUser::OnBoot() {
|
||||
|
||||
Reference in New Issue
Block a user