Bug 609574 - Crasher (also ASSERTION: invalid array index: 'i < Length()', file nsTArray.h). r=surkov,neil a=blocking2.0

This commit is contained in:
David Bolter 2010-11-09 14:34:25 -05:00
parent efca389758
commit 6ca53e4829

View File

@ -679,8 +679,10 @@ nsDocAccessible::Shutdown()
mParent->RemoveChild(this);
}
PRUint32 childDocCount = mChildDocuments.Length();
for (PRUint32 idx = 0; idx < childDocCount; idx++)
// Walk the array backwards because child documents remove themselves from the
// array as they are shutdown.
PRInt32 childDocCount = mChildDocuments.Length();
for (PRInt32 idx = childDocCount - 1; idx >= 0; idx--)
mChildDocuments[idx]->Shutdown();
mChildDocuments.Clear();