]> git.netwichtig.de Git - user/henk/code/inspircd.git/blobdiff - src/timer.cpp
Make xline expiry messages a bit clearer that the xline may have expired a while...
[user/henk/code/inspircd.git] / src / timer.cpp
index ca7534a7c7409759d42808258c3162db706f019a..27f2aecfdca8dd5cf8d5eb3f72b7287da90ba885 100644 (file)
@@ -2,7 +2,7 @@
  *       | Inspire Internet Relay Chat Daemon |
  *       +------------------------------------+
  *
- *  InspIRCd: (C) 2002-2008 InspIRCd Development Team
+ *  InspIRCd: (C) 2002-2009 InspIRCd Development Team
  * See: http://www.inspircd.org/wiki/index.php/Credits
  *
  * This program is free but copyrighted software; see
@@ -11,7 +11,7 @@
  * ---------------------------------------------------
  */
 
-/* $Core: libIRCDtimer */
+/* $Core */
 
 #include "inspircd.h"
 #include "timer.h"
@@ -26,6 +26,9 @@ void TimerManager::TickTimers(time_t TIME)
        {
                std::vector<Timer *>::iterator i = Timers.begin();
                Timer *t = (*i);
+               
+               // Probable fix: move vector manipulation to *before* we modify the vector.
+               Timers.erase(i);
 
                t->Tick(TIME);
                if (t->GetRepeat())
@@ -35,8 +38,6 @@ void TimerManager::TickTimers(time_t TIME)
                }
                else
                        delete t;
-
-               Timers.erase(i);
        }
 }