]> granicus.if.org Git - icinga2/commitdiff
Fix a crash in Timer::Reschedule
authorGunnar Beutner <gunnar@beutner.name>
Fri, 27 Feb 2015 15:44:33 +0000 (16:44 +0100)
committerGunnar Beutner <gunnar@beutner.name>
Fri, 27 Feb 2015 15:44:33 +0000 (16:44 +0100)
refs #8554

lib/base/timer.cpp

index 632f4a226821056abab1de6bf62edccab029867f..4bd22de265fa9372664e166b86a88d7424f4a7b4 100644 (file)
@@ -183,7 +183,6 @@ void Timer::Stop(void)
 void Timer::Reschedule(double next)
 {
        ASSERT(!OwnsLock());
-       ASSERT(!m_Running);
 
        boost::mutex::scoped_lock lock(l_TimerMutex);
 
@@ -197,7 +196,7 @@ void Timer::Reschedule(double next)
 
        m_Next = next;
 
-       if (m_Started) {
+       if (m_Started && !m_Running) {
                /* Remove and re-add the timer to update the index. */
                l_Timers.erase(this);
                l_Timers.insert(this);