summaryrefslogtreecommitdiff
path: root/sw/source/uibase/utlui/numfmtlb.cxx
diff options
context:
space:
mode:
authorTakeshi Abe <tabe@fixedpoint.jp>2014-06-20 06:54:55 +0900
committerTakeshi Abe <tabe@fixedpoint.jp>2014-06-20 10:20:39 +0900
commit67f64c266cd5a0368eff0be727228bc6a9c67cb2 (patch)
treeb54b9cf8371b834631a617baf9b85a33d51b2452 /sw/source/uibase/utlui/numfmtlb.cxx
parentd77c108922f7ea2c57bc63bbe289bba92f6213a6 (diff)
Avoid possible memory leaks in case of exceptions
Change-Id: Ic9b9c22c0ad15bfefce729e7277f950cb66d9bf6
Diffstat (limited to 'sw/source/uibase/utlui/numfmtlb.cxx')
-rw-r--r--sw/source/uibase/utlui/numfmtlb.cxx7
1 files changed, 3 insertions, 4 deletions
diff --git a/sw/source/uibase/utlui/numfmtlb.cxx b/sw/source/uibase/utlui/numfmtlb.cxx
index 55ac0d15725d..b3e37525f82a 100644
--- a/sw/source/uibase/utlui/numfmtlb.cxx
+++ b/sw/source/uibase/utlui/numfmtlb.cxx
@@ -41,6 +41,7 @@
#include "dialog.hrc"
#include <unomid.h>
#include <sfx2/viewfrm.hxx>
+#include <boost/scoped_ptr.hpp>
using namespace ::com::sun::star::uno;
using namespace ::com::sun::star::lang;
@@ -395,9 +396,9 @@ IMPL_LINK( NumFormatListBox, SelectHdl, ListBox *, pBox )
SwAbstractDialogFactory* pFact = SwAbstractDialogFactory::Create();
OSL_ENSURE(pFact, "SwAbstractDialogFactory fail!");
- SfxAbstractDialog* pDlg = pFact->CreateSfxDialog( this, aCoreSet,
+ boost::scoped_ptr<SfxAbstractDialog> pDlg(pFact->CreateSfxDialog( this, aCoreSet,
GetView()->GetViewFrame()->GetFrame().GetFrameInterface(),
- RC_DLG_SWNUMFMTDLG );
+ RC_DLG_SWNUMFMTDLG ));
OSL_ENSURE(pDlg, "Dialogdiet fail!");
if (RET_OK == pDlg->Execute())
@@ -433,8 +434,6 @@ IMPL_LINK( NumFormatListBox, SelectHdl, ListBox *, pBox )
}
else
SetDefFormat(nFormat);
-
- delete pDlg;
}
return 0;
}