- // This will come back and remove

- // the current item each time.  Is
- // that OK?

No, it is not OK. This messes up the vector and confuses the iterator.
And it leads to crashes. Better read the vector in reverse order.
This commit is contained in:
mfranz
2006-10-22 13:08:09 +00:00
parent 811442832e
commit 4f0bfbab21

View File

@@ -2286,12 +2286,8 @@ SGPropertyNode::hash_table::hashcode (const char * key)
SGPropertyChangeListener::~SGPropertyChangeListener ()
{
// This will come back and remove
// the current item each time. Is
// that OK?
vector<SGPropertyNode *>::iterator it;
for (it = _properties.begin(); it != _properties.end(); it++)
(*it)->removeChangeListener(this);
for (int i = _properties.size() - 1; i >= 0; i--)
_properties[i]->removeChangeListener(this);
}
void