Dependency#OnAllConfigLoaded(): don't link *this with the child if *this is going to be dropped

refs #7536
This commit is contained in:
Alexander A. Klimov 2019-09-25 11:30:50 +02:00
parent ac684ec128
commit 7668314b4a
1 changed files with 1 additions and 2 deletions

View File

@ -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);
}