Make sure to null out mRootContent in Destroy when we unbind it. Bug 326645, r+sr+branch181=sicking

This commit is contained in:
bzbarsky%mit.edu 2006-06-08 04:41:24 +00:00
parent d82cef21db
commit 642b358e3a

View File

@ -4759,7 +4759,17 @@ nsDocument::Destroy()
mIsGoingAway = PR_TRUE;
DestroyLinkMap();
for (PRInt32 indx = 0; indx < count; ++indx) {
mChildren.ChildAt(indx)->UnbindFromTree();
nsIContent* content = mChildren.ChildAt(indx);
if (content == mRootContent) {
// Null out mRootContent first; this is similar to what RemoveChildAt()
// does.
mRootContent = nsnull;
}
// XXXbz what about document observer notifications? We really need to get
// rid of this Destroy() method!
content->UnbindFromTree();
}
// Propagate the out-of-band notification to each PresShell's anonymous