Bug 353021, crashes [@ PL_DHashTableOperate] removing from nsDOMClassInfo's sExternallyReferencedTable, r+sr=dbaron

This commit is contained in:
Olli.Pettay%helsinki.fi 2007-01-02 18:51:42 +00:00
parent 44067db0cb
commit dc30e99cc1

View File

@ -5422,8 +5422,19 @@ nsDOMClassInfo::UnsetExternallyReferenced(nsIDOMGCParticipant *aParticipant)
{
NS_PRECONDITION(aParticipant, "unexpected null pointer");
PL_DHashTableOperate(&sExternallyReferencedTable, aParticipant,
PL_DHASH_REMOVE);
NS_ASSERTION(sExternallyReferencedTable.ops,
"Unexpected null sExternallyReferencedTable.ops");
if (sExternallyReferencedTable.ops) {
#ifdef DEBUG
PRUint32 count = sExternallyReferencedTable.entryCount;
#endif
PL_DHashTableOperate(&sExternallyReferencedTable, aParticipant,
PL_DHASH_REMOVE);
#ifdef DEBUG
NS_ASSERTION(count != sExternallyReferencedTable.entryCount,
"DOMGCParticipant wasn't removed from sExternallyReferencedTable.");
#endif
}
// Don't destroy the table when the entryCount hits zero, since that
// is expected to happen often. Instead, destroy it at shutdown.