diff options
author | Takeshi Abe <tabe@fixedpoint.jp> | 2014-01-21 10:18:02 +0900 |
---|---|---|
committer | Takeshi Abe <tabe@fixedpoint.jp> | 2014-01-21 10:20:41 +0900 |
commit | 276cae1e467af0219ea1a45bac331937d7b9dc63 (patch) | |
tree | 2dbc72854d7381fd2023946d03d040e460ee621e /sw/source/ui/dochdl | |
parent | 15974abe63f0d4fc88099634d5cd2ddb9760ec23 (diff) |
Use boost::scoped_ptr to avoid resource leaks in case of exception
Change-Id: I05a17a061bfd4c3dbd15fe80c1f1f4f8d8267ea7
Diffstat (limited to 'sw/source/ui/dochdl')
-rw-r--r-- | sw/source/ui/dochdl/swdtflvr.cxx | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/sw/source/ui/dochdl/swdtflvr.cxx b/sw/source/ui/dochdl/swdtflvr.cxx index 00be9a021642..824cfbc0b276 100644 --- a/sw/source/ui/dochdl/swdtflvr.cxx +++ b/sw/source/ui/dochdl/swdtflvr.cxx @@ -119,6 +119,8 @@ #include <vcl/GraphicNativeTransform.hxx> #include <vcl/GraphicNativeMetadata.hxx> +#include <boost/scoped_ptr.hpp> + extern bool bFrmDrag; extern bool bDDINetAttr; extern bool bExecuteDrag; @@ -2821,7 +2823,7 @@ bool SwTransferable::PasteSpecial( SwWrtShell& rSh, TransferableDataHelper& rDat { bool nRet = false; SvxAbstractDialogFactory* pFact = SvxAbstractDialogFactory::Create(); - SfxAbstractPasteDialog* pDlg = pFact->CreatePasteDialog( &rSh.GetView().GetEditWin() ); + boost::scoped_ptr<SfxAbstractPasteDialog> pDlg(pFact->CreatePasteDialog( &rSh.GetView().GetEditWin() )); DataFlavorExVector aFormats( rData.GetDataFlavorExVector() ); TransferableObjectDescriptor aDesc; @@ -2884,7 +2886,6 @@ bool SwTransferable::PasteSpecial( SwWrtShell& rSh, TransferableDataHelper& rDat if ( nRet ) rFormatUsed = nFormat; - delete pDlg; return nRet; } |