]> granicus.if.org Git - icinga2/commitdiff
Fix crash in Downtime::DowntimesExpireTimerHandler
authorGunnar Beutner <gunnar.beutner@netways.de>
Tue, 12 Apr 2016 10:04:38 +0000 (12:04 +0200)
committerGunnar Beutner <gunnar.beutner@netways.de>
Wed, 20 Apr 2016 08:09:34 +0000 (10:09 +0200)
fixes #11534
fixes #11559

lib/icinga/comment.cpp
lib/icinga/downtime.cpp
lib/notification/notificationcomponent.cpp

index b411a4143ac514987506b54790320a7eed406635..85c5f1a17faf3aa9c68927cecb4b66baa668a8bf 100644 (file)
@@ -244,7 +244,7 @@ void Comment::CommentsExpireTimerHandler(void)
        }
 
        BOOST_FOREACH(const Comment::Ptr& comment, comments) {
-               if (comment->IsExpired())
+               if (comment->IsActive() && comment->IsExpired())
                        RemoveComment(comment->GetName());
        }
 }
index d7668f79564b9c7ab27d76d3c02aaba3974e1686..2d18383028940e8e774af49ac070ce37c15d34e3 100644 (file)
@@ -358,7 +358,7 @@ void Downtime::DowntimesExpireTimerHandler(void)
        }
 
        BOOST_FOREACH(const Downtime::Ptr& downtime, downtimes) {
-               if (downtime->IsExpired())
+               if (downtime->IsActive() && downtime->IsExpired())
                        RemoveDowntime(downtime->GetName(), false, true);
        }
 }
index 3a1cf54def3afc3c9173cfa3cccab816929c4a22..abf1d7d75dc1a22414eade9345bb7201d8064e05 100644 (file)
@@ -72,6 +72,9 @@ void NotificationComponent::NotificationTimerHandler(void)
        double now = Utility::GetTime();
 
        BOOST_FOREACH(const Notification::Ptr& notification, ConfigType::GetObjectsByType<Notification>()) {
+               if (!notification->IsActive())
+                       continue;
+
                Checkable::Ptr checkable = notification->GetCheckable();
 
                if (checkable->IsPaused() && GetEnableHA())