summaryrefslogtreecommitdiff
path: root/cui/source/factory/init.cxx
diff options
context:
space:
mode:
authorTakeshi Abe <tabe@fixedpoint.jp>2014-07-30 14:29:31 +0900
committerTakeshi Abe <tabe@fixedpoint.jp>2014-07-30 14:31:07 +0900
commitc0d298ecec6a615c8f1137c63df5bc484ee9ca33 (patch)
treecb83cc683615c313bc765cea5c01c1e562b8931c /cui/source/factory/init.cxx
parent8cb75e905cef50a2d8a423443d3dcef5f1899027 (diff)
Avoid possible memory leaks in case of exceptions
Change-Id: I9783669a26fd9c9e2c890f430b29427ccf6bea77
Diffstat (limited to 'cui/source/factory/init.cxx')
-rw-r--r--cui/source/factory/init.cxx5
1 files changed, 2 insertions, 3 deletions
diff --git a/cui/source/factory/init.cxx b/cui/source/factory/init.cxx
index 12d1316f57cc..80d25ee33022 100644
--- a/cui/source/factory/init.cxx
+++ b/cui/source/factory/init.cxx
@@ -19,7 +19,7 @@
#include <vcl/msgbox.hxx>
#include "cuicharmap.hxx"
-
+#include <boost/scoped_ptr.hpp>
// hook to call special character dialog for edits
// caution: needs C-Linkage since dynamically loaded via symbol name
@@ -28,7 +28,7 @@ extern "C"
SAL_DLLPUBLIC_EXPORT bool GetSpecialCharsForEdit(Window* i_pParent, const Font& i_rFont, OUString& o_rResult)
{
bool bRet = false;
- SvxCharacterMap* aDlg = new SvxCharacterMap( i_pParent );
+ boost::scoped_ptr<SvxCharacterMap> aDlg(new SvxCharacterMap( i_pParent ));
aDlg->DisableFontSelection();
aDlg->SetCharFont(i_rFont);
if ( aDlg->Execute() == RET_OK )
@@ -36,7 +36,6 @@ SAL_DLLPUBLIC_EXPORT bool GetSpecialCharsForEdit(Window* i_pParent, const Font&
o_rResult = aDlg->GetCharacters();
bRet = true;
}
- delete aDlg;
return bRet;
}
}