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:
@@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user