From 39008eff4ee58a0dc88209446fd1c2531283ac56 Mon Sep 17 00:00:00 2001 From: Gunnar Beutner Date: Fri, 8 Feb 2013 11:22:42 +0100 Subject: [PATCH] Fixed infinite loop bug in Service::BeginExecuteCheck. --- lib/icinga/service.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lib/icinga/service.cpp b/lib/icinga/service.cpp index ea0128456..260fd95a4 100644 --- a/lib/icinga/service.cpp +++ b/lib/icinga/service.cpp @@ -661,7 +661,9 @@ void Service::BeginExecuteCheck(const function& callback) arguments.push_back(static_cast(GetSelf())); ScriptTask::Ptr task; task = InvokeMethod("check", arguments, boost::bind(&Service::CheckCompletedHandler, this, scheduleInfo, _1, callback)); - Set("current_task", task); + + if (!task->IsFinished()) + Set("current_task", task); } catch (...) { /* something went wrong while setting up the method call - * reschedule the service and call the callback anyway. */ -- 2.40.0