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)
|
||||
{
|
||||
DynamicObject::AttributeIterator prev, at;
|
||||
for (at = m_Attributes.begin(); at != m_Attributes.end(); ) {
|
||||
if (at->second.Type == type) {
|
||||
prev = at;
|
||||
at++;
|
||||
m_Attributes.erase(prev);
|
||||
|
||||
DynamicObject::AttributeIterator at;
|
||||
for (at = m_Attributes.begin(); at != m_Attributes.end(); at++) {
|
||||
if (at->second.Type != type)
|
||||
continue;
|
||||
}
|
||||
|
||||
at++;
|
||||
at->second.Tx = 0;
|
||||
at->second.Data = Empty;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue