Bug: clearing attributes should only reset their value and tx rather than deleting them entirely

Fixes #3604
This commit is contained in:
Gunnar Beutner 2013-02-01 19:01:51 +01:00
parent 7835563e03
commit ee6ba4e5e9
1 changed files with 5 additions and 9 deletions

View File

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