]> granicus.if.org Git - icinga2/commitdiff
add some object locking to the Dump method (which could theoreticylly suffer from...
authorElias Ohm <eohm@novomind.com>
Wed, 1 May 2019 09:49:07 +0000 (11:49 +0200)
committerElias Ohm <eohm@novomind.com>
Wed, 1 May 2019 09:49:07 +0000 (11:49 +0200)
lib/icinga/timeperiod.cpp

index 21b1271d7bfb12429cf0708c4ab21cfc932f8495..27b92d550c55011b56fd114a5c93bfacbf254ed4 100644 (file)
@@ -221,6 +221,7 @@ void TimePeriod::Merge(const TimePeriod::Ptr& timeperiod, bool include)
 void TimePeriod::UpdateRegion(double begin, double end, bool clearExisting)
 {
        if (clearExisting) {
+               ObjectLock olock(this);
                SetSegments(new Array());
        } else {
                if (begin < GetValidEnd())
@@ -346,6 +347,8 @@ void TimePeriod::UpdateTimerHandler()
 
 void TimePeriod::Dump()
 {
+       ObjectLock olock(this);
+
        Array::Ptr segments = GetSegments();
 
        Log(LogDebug, "TimePeriod")