[icinga-checkins] icinga.org: icinga2/master: Fix crash in TimePeriod::UpdateRegion().

git at icinga.org git at icinga.org
Fri Mar 15 13:32:01 CET 2013


Module: icinga2
Branch: master
Commit: 14c837a208918b4a33517c351e6ebc39126c7b60
URL:    https://git.icinga.org/?p=icinga2.git;a=commit;h=14c837a208918b4a33517c351e6ebc39126c7b60

Author: Gunnar Beutner <gunnar.beutner at netways.de>
Date:   Fri Mar 15 13:29:25 2013 +0100

Fix crash in TimePeriod::UpdateRegion().

---

 lib/icinga/timeperiod.cpp |    7 ++++---
 1 files changed, 4 insertions(+), 3 deletions(-)

diff --git a/lib/icinga/timeperiod.cpp b/lib/icinga/timeperiod.cpp
index 8352b19..66093a4 100644
--- a/lib/icinga/timeperiod.cpp
+++ b/lib/icinga/timeperiod.cpp
@@ -210,6 +210,7 @@ void TimePeriod::UpdateRegion(double begin, double end)
 		ObjectLock olock(this);
 		RemoveSegment(begin, end);
 
+		ObjectLock dlock(segments);
 		BOOST_FOREACH(const Dictionary::Ptr& segment, segments) {
 			AddSegment(segment);
 		}
@@ -284,9 +285,9 @@ void TimePeriod::EmptyTimePeriodUpdate(const ScriptTask::Ptr& task, const vector
 	if (arguments.size() < 3)
 		BOOST_THROW_EXCEPTION(runtime_error("Expected 3 arguments."));
 
-	TimePeriod::Ptr tp = arguments[0];
-	double begin = arguments[1];
-	double end = arguments[2];
+//	TimePeriod::Ptr tp = arguments[0];
+//	double begin = arguments[1];
+//	double end = arguments[2];
 
 	Array::Ptr segments = boost::make_shared<Array>();
 	task->FinishResult(segments);





More information about the icinga-checkins mailing list