]> granicus.if.org Git - icinga2/commitdiff
Fix that TimePeriod segments are not cleared on restart 6386/head
authorNoah Hilverling <noah.hilverling@icinga.com>
Tue, 19 Jun 2018 08:30:34 +0000 (10:30 +0200)
committerNoah Hilverling <noah.hilverling@icinga.com>
Tue, 19 Jun 2018 08:30:34 +0000 (10:30 +0200)
refs #6282

lib/icinga/timeperiod.cpp

index 97183223e253a808a01ed6b6a509c00c07456b5d..28f418a327c7cf51c84ba89d805580be062da178 100644 (file)
@@ -235,7 +235,9 @@ void TimePeriod::Merge(const TimePeriod::Ptr& timeperiod, bool include)
 
 void TimePeriod::UpdateRegion(double begin, double end, bool clearExisting)
 {
-       if (!clearExisting) {
+       if (clearExisting) {
+               SetSegments(new Array());
+       } else {
                if (begin < GetValidEnd())
                        begin = GetValidEnd();