improved fix for bug 15696 (leaking an atom). r=floppy moose

This commit is contained in:
jfrancis%netscape.com 1999-11-17 11:26:41 +00:00
parent 54f5ef35c3
commit ab64f11257
2 changed files with 6 additions and 8 deletions

View File

@ -160,9 +160,9 @@ NS_IMETHODIMP PlaceholderTxn::Merge(PRBool *aDidMerge, nsITransaction *aTransact
editTxn->QueryInterface(nsIAbsorbingTransaction::GetIID(), getter_AddRefs(plcTxn));
if (plcTxn)
{
nsIAtom *atom;
plcTxn->GetTxnName(&atom);
if (atom && (atom == mName.get()))
nsCOMPtr<nsIAtom> atom;
plcTxn->GetTxnName(getter_AddRefs(atom));
if (atom && (atom == mName))
{
nsCOMPtr<nsIDOMNode> otherTxnStartNode;
PRInt32 otherTxnStartOffset;
@ -177,7 +177,6 @@ NS_IMETHODIMP PlaceholderTxn::Merge(PRBool *aDidMerge, nsITransaction *aTransact
*aDidMerge = PR_TRUE;
}
}
NS_IF_RELEASE(atom);
}
}
}

View File

@ -160,9 +160,9 @@ NS_IMETHODIMP PlaceholderTxn::Merge(PRBool *aDidMerge, nsITransaction *aTransact
editTxn->QueryInterface(nsIAbsorbingTransaction::GetIID(), getter_AddRefs(plcTxn));
if (plcTxn)
{
nsIAtom *atom;
plcTxn->GetTxnName(&atom);
if (atom && (atom == mName.get()))
nsCOMPtr<nsIAtom> atom;
plcTxn->GetTxnName(getter_AddRefs(atom));
if (atom && (atom == mName))
{
nsCOMPtr<nsIDOMNode> otherTxnStartNode;
PRInt32 otherTxnStartOffset;
@ -177,7 +177,6 @@ NS_IMETHODIMP PlaceholderTxn::Merge(PRBool *aDidMerge, nsITransaction *aTransact
*aDidMerge = PR_TRUE;
}
}
NS_IF_RELEASE(atom);
}
}
}