mirror of https://github.com/Icinga/icinga2.git
Bug: clearing attributes should only reset their value and tx rather than deleting them entirely
Fixes #3604
This commit is contained in:
parent
7835563e03
commit
ee6ba4e5e9
|
@ -215,17 +215,13 @@ bool DynamicObject::HasAttribute(const String& name) const
|
||||||
|
|
||||||
void DynamicObject::ClearAttributesByType(DynamicAttributeType type)
|
void DynamicObject::ClearAttributesByType(DynamicAttributeType type)
|
||||||
{
|
{
|
||||||
DynamicObject::AttributeIterator prev, at;
|
DynamicObject::AttributeIterator at;
|
||||||
for (at = m_Attributes.begin(); at != m_Attributes.end(); ) {
|
for (at = m_Attributes.begin(); at != m_Attributes.end(); at++) {
|
||||||
if (at->second.Type == type) {
|
if (at->second.Type != type)
|
||||||
prev = at;
|
|
||||||
at++;
|
|
||||||
m_Attributes.erase(prev);
|
|
||||||
|
|
||||||
continue;
|
continue;
|
||||||
}
|
|
||||||
|
|
||||||
at++;
|
at->second.Tx = 0;
|
||||||
|
at->second.Data = Empty;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue