diff options
author | Takeshi Abe <tabe@fixedpoint.jp> | 2014-01-24 10:36:12 +0900 |
---|---|---|
committer | Takeshi Abe <tabe@fixedpoint.jp> | 2014-01-24 10:43:43 +0900 |
commit | 530ddca40fc939a4d6ba6db503f0e49c10af4298 (patch) | |
tree | b6f50a86ce5dfd0afd869f2a841a7beeb65662e1 /sw/source/ui/dochdl | |
parent | 2d041ee46f68caf9760575d971127c27e279d2ef (diff) |
Avoid resource leaks in case of exception
Change-Id: I25d012b400ce0f467e6dfa03517bfebd9c945a66
Diffstat (limited to 'sw/source/ui/dochdl')
-rw-r--r-- | sw/source/ui/dochdl/swdtflvr.cxx | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/sw/source/ui/dochdl/swdtflvr.cxx b/sw/source/ui/dochdl/swdtflvr.cxx index 326b49296b96..6960868b6fad 100644 --- a/sw/source/ui/dochdl/swdtflvr.cxx +++ b/sw/source/ui/dochdl/swdtflvr.cxx @@ -1160,7 +1160,7 @@ bool SwTransferable::PasteData( TransferableDataHelper& rData, { SwWait aWait( *rSh.GetView(). GetDocShell(), false ); - SwTrnsfrActionAndUndo* pAction = 0; + boost::scoped_ptr<SwTrnsfrActionAndUndo> pAction; SwModule* pMod = SW_MOD(); bool nRet = false; @@ -1214,8 +1214,8 @@ bool SwTransferable::PasteData( TransferableDataHelper& rData, if( bDelSel ) // #i34830# - pAction = new SwTrnsfrActionAndUndo( &rSh, UNDO_PASTE_CLIPBOARD, NULL, - sal_True ); + pAction.reset(new SwTrnsfrActionAndUndo( &rSh, UNDO_PASTE_CLIPBOARD, NULL, + sal_True )); } SwTransferable *pTrans=0, *pTunneledTrans=GetSwTransferable( rData ); @@ -1260,7 +1260,7 @@ bool SwTransferable::PasteData( TransferableDataHelper& rData, { if( !pAction ) { - pAction = new SwTrnsfrActionAndUndo( &rSh, UNDO_PASTE_CLIPBOARD); + pAction.reset(new SwTrnsfrActionAndUndo( &rSh, UNDO_PASTE_CLIPBOARD)); } // in Drag&Drop MessageBoxes must not be showed @@ -1521,7 +1521,7 @@ bool SwTransferable::PasteData( TransferableDataHelper& rData, rSh.GetView().StopShellTimer(); } - delete pAction; + pAction.reset(); if( bCallAutoCaption ) rSh.GetView().AutoCaption( GRAPHIC_CAP ); |