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/misc/insfnote.cxx | |
parent | 15974abe63f0d4fc88099634d5cd2ddb9760ec23 (diff) |
Use boost::scoped_ptr to avoid resource leaks in case of exception
Change-Id: I05a17a061bfd4c3dbd15fe80c1f1f4f8d8267ea7
Diffstat (limited to 'sw/source/ui/misc/insfnote.cxx')
-rw-r--r-- | sw/source/ui/misc/insfnote.cxx | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/sw/source/ui/misc/insfnote.cxx b/sw/source/ui/misc/insfnote.cxx index 52c5c187a4e6..765c4af1505f 100644 --- a/sw/source/ui/misc/insfnote.cxx +++ b/sw/source/ui/misc/insfnote.cxx @@ -38,6 +38,8 @@ #include <sfx2/viewfrm.hxx> #include <vcl/layout.hxx> +#include <boost/scoped_ptr.hpp> + static sal_Bool bFootnote = sal_True; /*------------------------------------------------------------------------ @@ -121,8 +123,8 @@ IMPL_LINK_NOARG(SwInsFootNoteDlg, NumberExtCharHdl) aAllSet.Put( rFont ); SvxAbstractDialogFactory* pFact = SvxAbstractDialogFactory::Create(); - SfxAbstractDialog* pDlg = pFact->CreateSfxDialog( this, aAllSet, - rSh.GetView().GetViewFrame()->GetFrame().GetFrameInterface(), RID_SVXDLG_CHARMAP ); + boost::scoped_ptr<SfxAbstractDialog> pDlg(pFact->CreateSfxDialog( this, aAllSet, + rSh.GetView().GetViewFrame()->GetFrame().GetFrameInterface(), RID_SVXDLG_CHARMAP )); if (RET_OK == pDlg->Execute()) { SFX_ITEMSET_ARG( pDlg->GetOutputItemSet(), pItem, SfxStringItem, SID_CHARMAP, sal_False ); @@ -145,7 +147,6 @@ IMPL_LINK_NOARG(SwInsFootNoteDlg, NumberExtCharHdl) m_pOkBtn->Enable(!m_pNumberCharEdit->GetText().isEmpty()); } } - delete pDlg; return 0; } |