From: Alexander A. Klimov Date: Wed, 25 Sep 2019 09:30:50 +0000 (+0200) Subject: Dependency#OnAllConfigLoaded(): don't link *this with the child if *this is going... X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=7668314b4a468ef1f5316fc60773360fdaf5b5e6;p=icinga2 Dependency#OnAllConfigLoaded(): don't link *this with the child if *this is going to be dropped refs #7536 --- diff --git a/lib/icinga/dependency.cpp b/lib/icinga/dependency.cpp index d2261cfe1..bfb91d226 100644 --- a/lib/icinga/dependency.cpp +++ b/lib/icinga/dependency.cpp @@ -75,8 +75,6 @@ void Dependency::OnAllConfigLoaded() if (!m_Child) BOOST_THROW_EXCEPTION(ScriptError("Dependency '" + GetName() + "' references a child host/service which doesn't exist.", GetDebugInfo())); - m_Child->AddDependency(this); - Host::Ptr parentHost = Host::GetByName(GetParentHostName()); if (parentHost) { @@ -89,6 +87,7 @@ void Dependency::OnAllConfigLoaded() if (!m_Parent) BOOST_THROW_EXCEPTION(ScriptError("Dependency '" + GetName() + "' references a parent host/service which doesn't exist.", GetDebugInfo())); + m_Child->AddDependency(this); m_Parent->AddReverseDependency(this); }