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
Родитель 706087d0e6
Коммит a831df5abb
1 изменённых файлов: 4 добавлений и 2 удалений

Просмотреть файл

@ -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();