Fix for bug 406684 (Memory leaks when content policies set properties of wrapped nodes). r/sr=sicking.

git-svn-id: svn://10.0.0.236/trunk@240467 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
peterv%propagandism.org
2007-12-05 00:29:13 +00:00
parent ec1862dcf0
commit 00ff48fd86
2 changed files with 8 additions and 1 deletions

View File

@@ -5583,6 +5583,13 @@ nsDocument::Destroy()
mLayoutHistoryState = nsnull;
nsContentList::OnDocumentDestroy(this);
// XXX We really should let cycle collection do this, but that currently still
// leaks (see https://bugzilla.mozilla.org/show_bug.cgi?id=406684).
// When we start relying on cycle collection again we should remove the
// check for mScriptGlobalObject in AddReference.
delete mContentWrapperHash;
mContentWrapperHash = nsnull;
}
already_AddRefed<nsILayoutHistoryState>

View File

@@ -988,7 +988,7 @@ NS_IMPL_CYCLE_COLLECTION_UNLINK_BEGIN(nsGlobalWindow)
// Unlink any associated preserved wrapper.
if (tmp->mDoc) {
tmp->mDoc->RemoveReference(tmp->mDoc.get());
tmp->mDoc->RemoveReference(tmp);
NS_IMPL_CYCLE_COLLECTION_UNLINK_NSCOMPTR(mDoc)
}