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/dialogs/pastedlg.cxx | |
parent | 8cb75e905cef50a2d8a423443d3dcef5f1899027 (diff) |
Avoid possible memory leaks in case of exceptions
Change-Id: I9783669a26fd9c9e2c890f430b29427ccf6bea77
Diffstat (limited to 'cui/source/dialogs/pastedlg.cxx')
-rw-r--r-- | cui/source/dialogs/pastedlg.cxx | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/cui/source/dialogs/pastedlg.cxx b/cui/source/dialogs/pastedlg.cxx index 0530383c38cb..e1e984d8105e 100644 --- a/cui/source/dialogs/pastedlg.cxx +++ b/cui/source/dialogs/pastedlg.cxx @@ -35,6 +35,7 @@ #include <vcl/settings.hxx> #include <dialmgr.hxx> +#include <boost/scoped_ptr.hpp> SvPasteObjectDialog::SvPasteObjectDialog( Window* pParent ) : ModalDialog(pParent, "PasteSpecialDialog", "cui/ui/pastespecial.ui") @@ -175,11 +176,10 @@ sal_uLong SvPasteObjectDialog::GetFormat( const TransferableDataHelper& rHelper, if( aTypeName.isEmpty() && aSourceName.isEmpty() ) { - ResMgr* pMgr = ResMgr::CreateResMgr( "svt", Application::GetSettings().GetUILanguageTag() ); + boost::scoped_ptr<ResMgr> pMgr(ResMgr::CreateResMgr( "svt", Application::GetSettings().GetUILanguageTag() )); // global resource from svtools (former so3 resource) if( pMgr ) aSourceName = OUString( ResId( STR_UNKNOWN_SOURCE, *pMgr ) ); - delete pMgr; } } |