summaryrefslogtreecommitdiff
path: root/extensions
diff options
context:
space:
mode:
authorTakeshi Abe <tabe@fixedpoint.jp>2014-08-25 10:22:59 +0900
committerTakeshi Abe <tabe@fixedpoint.jp>2014-08-25 10:27:10 +0900
commit32ce5ae15a8f156b4681c36d248b6731df3457c6 (patch)
treefba1a1f0e0300b8e4209d593e3cfc7062542a72a /extensions
parent49feed98a1efa5accb9da4ab280d7cd47dcb344a (diff)
Avoid possible memory leaks in case of exceptions
Change-Id: Icc073be041ae0b0c690e869a0edaff3515d1d601
Diffstat (limited to 'extensions')
-rw-r--r--extensions/source/bibliography/datman.cxx7
1 files changed, 3 insertions, 4 deletions
diff --git a/extensions/source/bibliography/datman.cxx b/extensions/source/bibliography/datman.cxx
index cc7bb58a3abc..f314500fccf5 100644
--- a/extensions/source/bibliography/datman.cxx
+++ b/extensions/source/bibliography/datman.cxx
@@ -68,6 +68,7 @@
#include "bib.hrc"
#include "bibliography.hrc"
#include <connectivity/dbtools.hxx>
+#include <boost/scoped_ptr.hpp>
using namespace ::com::sun::star;
using namespace ::com::sun::star::beans;
@@ -1433,18 +1434,17 @@ void BibDataManager::RemoveMeAsUidListener()
void BibDataManager::CreateMappingDialog(Window* pParent)
{
- MappingDialog_Impl* pDlg = new MappingDialog_Impl(pParent, this);
+ boost::scoped_ptr<MappingDialog_Impl> pDlg(new MappingDialog_Impl(pParent, this));
if(RET_OK == pDlg->Execute() && pBibView)
{
reload();
}
- delete pDlg;
}
OUString BibDataManager::CreateDBChangeDialog(Window* pParent)
{
OUString uRet;
- DBChangeDialog_Impl * pDlg = new DBChangeDialog_Impl(pParent, this );
+ boost::scoped_ptr<DBChangeDialog_Impl> pDlg(new DBChangeDialog_Impl(pParent, this ));
if(RET_OK == pDlg->Execute())
{
OUString sNewURL = pDlg->GetCurrentURL();
@@ -1453,7 +1453,6 @@ OUString BibDataManager::CreateDBChangeDialog(Window* pParent)
uRet = sNewURL;
}
}
- delete pDlg;
return uRet;
}