Fix leak of transactions. b=174123 r=jfrancis sr=kin a=rjesup

This commit is contained in:
dbaron%fas.harvard.edu 2002-10-14 23:48:05 +00:00
parent 4390c6484e
commit 84f5669319

View File

@ -492,13 +492,12 @@ nsEditor::Do(nsITransaction *aTxn)
if (mTxnMgr)
{
nsITransaction *topTxn = 0;
result = mTxnMgr->PeekUndoStack(&topTxn);
nsCOMPtr<nsITransaction> topTxn;
result = mTxnMgr->PeekUndoStack(getter_AddRefs(topTxn));
if (NS_FAILED(result)) return result;
if (topTxn)
{
plcTxn = nsnull;
topTxn->QueryInterface(NS_GET_IID(nsIAbsorbingTransaction), getter_AddRefs(plcTxn));
plcTxn = do_QueryInterface(topTxn);
if (plcTxn)
{
// there is a palceholder transaction on top of the undo stack. It is