Bug 349069, Move more things from ~nsINode to nsNodeUtils::LastRelease, r+sr=sicking

This commit is contained in:
Olli.Pettay@helsinki.fi
2006-09-02 13:21:05 +00:00
parent 4136feabbc
commit 797c306c97
11 changed files with 90 additions and 88 deletions

View File

@@ -143,36 +143,7 @@ nsresult NS_NewContentIterator(nsIContentIterator** aInstancePtrResult);
nsINode::~nsINode()
{
NS_ASSERTION(!HasSlots(), "Don't know how to kill the slots");
if (HasFlag(NODE_HAS_RANGELIST)) {
#ifdef DEBUG
if (!nsContentUtils::LookupRangeList(this) &&
nsContentUtils::IsInitialized()) {
NS_ERROR("Huh, our bit says we have a range list, but there's nothing "
"in the hash!?!!");
}
#endif
nsContentUtils::RemoveRangeList(this);
}
if (HasFlag(NODE_HAS_LISTENERMANAGER)) {
#ifdef DEBUG
if (nsContentUtils::IsInitialized()) {
nsCOMPtr<nsIEventListenerManager> manager;
PRBool created;
nsContentUtils::GetListenerManager(this, PR_FALSE,
getter_AddRefs(manager), &created);
if (!manager) {
NS_ERROR("Huh, our bit says we have a listener manager list, "
"but there's nothing in the hash!?!!");
}
}
#endif
nsContentUtils::RemoveListenerManager(this);
}
NS_ASSERTION(!HasSlots(), "nsNodeUtils::LastRelease was not called?");
}
void*
@@ -1019,8 +990,6 @@ nsGenericElement::~nsGenericElement()
{
NS_PRECONDITION(!IsInDoc(),
"Please remove this from the document properly");
nsNodeUtils::NodeWillBeDestroyed(this);
}
/**
@@ -3092,7 +3061,7 @@ NS_INTERFACE_MAP_END
NS_IMPL_ADDREF(nsGenericElement)
NS_IMPL_RELEASE_WITH_DESTROY(nsGenericElement,
nsNodeUtils::LastRelease(this))
nsNodeUtils::LastRelease(this, PR_TRUE))
nsresult
nsGenericElement::PostQueryInterface(REFNSIID aIID, void** aInstancePtr)