fix for blocker bug #106646. hyatt's hack applied to the ContentReplaced() case.

sr=hyatt.
This commit is contained in:
sspitzer%netscape.com 2001-10-25 20:39:40 +00:00
Родитель b227e18dfe
Коммит 28d481fe6c
1 изменённых файлов: 9 добавлений и 0 удалений

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

@ -2117,6 +2117,15 @@ nsXULDocument::ContentReplaced(nsIContent* aContainer,
nsIDocumentObserver* observer = (nsIDocumentObserver*)mObservers[i];
observer->ContentReplaced(this, aContainer, aOldChild, aNewChild,
aIndexInContainer);
// XXXdwh hack to avoid crash, since an observer removes itself
// during ContentReplaced.
PRInt32 newCount = mObservers.Count();
if (newCount < count) {
PRInt32 diff = (count - newCount);
count -= diff;
i -= diff;
}
}
return NS_OK;
}