]> granicus.if.org Git - icinga2/commitdiff
Fixed infinite loop bug in Service::BeginExecuteCheck.
authorGunnar Beutner <gunnar.beutner@netways.de>
Fri, 8 Feb 2013 10:22:42 +0000 (11:22 +0100)
committerGunnar Beutner <gunnar.beutner@netways.de>
Fri, 8 Feb 2013 10:22:42 +0000 (11:22 +0100)
lib/icinga/service.cpp

index ea01284567ef52a7053662c8e7b743fd2261b5fd..260fd95a47fd70ddac143529cb5a2d8f77567bce 100644 (file)
@@ -661,7 +661,9 @@ void Service::BeginExecuteCheck(const function<void (void)>& callback)
                arguments.push_back(static_cast<Service::Ptr>(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. */