From: Noah Hilverling Date: Tue, 19 Jun 2018 08:30:34 +0000 (+0200) Subject: Fix that TimePeriod segments are not cleared on restart X-Git-Tag: v2.10.0~89^2 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=refs%2Fpull%2F6386%2Fhead;p=icinga2 Fix that TimePeriod segments are not cleared on restart refs #6282 --- diff --git a/lib/icinga/timeperiod.cpp b/lib/icinga/timeperiod.cpp index 97183223e..28f418a32 100644 --- a/lib/icinga/timeperiod.cpp +++ b/lib/icinga/timeperiod.cpp @@ -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();