Fix for bug 374449 (Most callers of nsIDocument::RemoveReference leak). r/sr=jst.

git-svn-id: svn://10.0.0.236/trunk@222104 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
peterv%propagandism.org
2007-03-20 17:39:25 +00:00
parent 0d2d7c9021
commit e0208d6f89
6 changed files with 29 additions and 19 deletions

View File

@@ -719,11 +719,10 @@ nsContentUtils::doReparentContentWrapper(nsIContent *aNode,
NS_ENSURE_SUCCESS(rv, rv);
if (aOldDocument) {
nsCOMPtr<nsISupports> old_ref = aOldDocument->RemoveReference(aNode);
nsCOMPtr<nsISupports> old_ref = aOldDocument->GetReference(aNode);
if (old_ref) {
// Transfer the reference from aOldDocument to aNewDocument
aOldDocument->RemoveReference(aNode);
aNewDocument->AddReference(aNode, old_ref);
}
}