Bug 522030 followup; do the release at a better point. Fixes orange.

This commit is contained in:
Boris Zbarsky 2009-10-13 19:34:41 -04:00
Родитель 1b31380cc9
Коммит 84d78d39d3
1 изменённых файлов: 3 добавлений и 1 удалений

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

@ -495,11 +495,13 @@ nsIdentifierMapEntry::RemoveIdContent(nsIContent* aContent)
nsIContent* currentContent = static_cast<nsIContent*>(mIdContentList.SafeElementAt(0));
if (!mIdContentList.RemoveElement(aContent))
return PR_FALSE;
NS_RELEASE(aContent);
if (currentContent == aContent) {
FireChangeCallbacks(currentContent,
static_cast<nsIContent*>(mIdContentList.SafeElementAt(0)));
}
// Make sure the release happens after the check above, since it'll
// null out aContent.
NS_RELEASE(aContent);
return mIdContentList.Count() == 0 && !mNameContentList && !mChangeCallbacks;
}