From 5c39502342c4eacdaca3c24de6717c426dcec291 Mon Sep 17 00:00:00 2001 From: psychon Date: Mon, 26 May 2008 14:59:41 +0000 Subject: [PATCH] Fix restarting of the connect user timer during rehashing Rehashing didn't always properly restart the connect user timer. This happened e.g. if rehashing fails because the config file doesn't exist. To fix this, we restart this timer now in the CZNC::RehashConfig() where it will *always* happen. This commit fixes a crash bug! (using an invalid iterator) git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1073 726aef4b-f618-498e-8847-2d620e286838 --- znc.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/znc.cpp b/znc.cpp index 87a68a8b..3ac6e8eb 100644 --- a/znc.cpp +++ b/znc.cpp @@ -865,6 +865,9 @@ bool CZNC::RehashConfig(CString& sError) m_msDelUsers = m_msUsers; m_msUsers.clear(); + // Make sure that timer doesn't have a stale iterator + DisableConnectUser(); + if (DoRehash(sError)) { #ifdef _MODULES GetModules().OnPostRehash(); @@ -884,6 +887,9 @@ bool CZNC::RehashConfig(CString& sError) m_msDelUsers.erase(m_msDelUsers.begin()); } + // Make sure that users that want to connect do so + RestartConnectUser(); + return false; }