diff options
author | Takeshi Abe <tabe@fixedpoint.jp> | 2014-07-30 14:29:31 +0900 |
---|---|---|
committer | Takeshi Abe <tabe@fixedpoint.jp> | 2014-07-30 14:31:07 +0900 |
commit | c0d298ecec6a615c8f1137c63df5bc484ee9ca33 (patch) | |
tree | cb83cc683615c313bc765cea5c01c1e562b8931c /cui/source/options/optlingu.cxx | |
parent | 8cb75e905cef50a2d8a423443d3dcef5f1899027 (diff) |
Avoid possible memory leaks in case of exceptions
Change-Id: I9783669a26fd9c9e2c890f430b29427ccf6bea77
Diffstat (limited to 'cui/source/options/optlingu.cxx')
-rw-r--r-- | cui/source/options/optlingu.cxx | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/cui/source/options/optlingu.cxx b/cui/source/options/optlingu.cxx index 1cd78d965ee1..a5f8f7a6392a 100644 --- a/cui/source/options/optlingu.cxx +++ b/cui/source/options/optlingu.cxx @@ -68,7 +68,7 @@ #include <vector> #include <map> - +#include <boost/scoped_ptr.hpp> using namespace ::ucbhelper; using namespace ::rtl; @@ -1624,7 +1624,7 @@ IMPL_LINK( SvxLinguTabPage, ClickHdl_Impl, PushButton *, pBtn ) SvxAbstractDialogFactory* pFact = SvxAbstractDialogFactory::Create(); if(pFact) { - AbstractSvxNewDictionaryDialog* aDlg = pFact->CreateSvxNewDictionaryDialog( this, xSpellChecker1 ); + boost::scoped_ptr<AbstractSvxNewDictionaryDialog> aDlg(pFact->CreateSvxNewDictionaryDialog( this, xSpellChecker1 )); DBG_ASSERT(aDlg, "Dialog creation failed!"); uno::Reference< XDictionary > xNewDic; if ( aDlg->Execute() == RET_OK ) @@ -1639,7 +1639,6 @@ IMPL_LINK( SvxLinguTabPage, ClickHdl_Impl, PushButton *, pBtn ) AddDicBoxEntry( xNewDic, (sal_uInt16) nLen ); } - delete aDlg; } } else if (m_pLinguDicsEditPB == pBtn) @@ -1660,10 +1659,9 @@ IMPL_LINK( SvxLinguTabPage, ClickHdl_Impl, PushButton *, pBtn ) SvxAbstractDialogFactory* pFact = SvxAbstractDialogFactory::Create(); if(pFact) { - VclAbstractDialog* aDlg = pFact->CreateSvxEditDictionaryDialog( this, xDic->getName(), xSpellChecker1, RID_SFXDLG_EDITDICT ); + boost::scoped_ptr<VclAbstractDialog> aDlg(pFact->CreateSvxEditDictionaryDialog( this, xDic->getName(), xSpellChecker1, RID_SFXDLG_EDITDICT )); DBG_ASSERT(aDlg, "Dialog creation failed!"); aDlg->Execute(); - delete aDlg; } } } |