summaryrefslogtreecommitdiff
path: root/sw/source/ui/app/docsh2.cxx
diff options
context:
space:
mode:
authorTakeshi Abe <tabe@fixedpoint.jp>2014-01-21 10:18:02 +0900
committerTakeshi Abe <tabe@fixedpoint.jp>2014-01-21 10:20:41 +0900
commit276cae1e467af0219ea1a45bac331937d7b9dc63 (patch)
tree2dbc72854d7381fd2023946d03d040e460ee621e /sw/source/ui/app/docsh2.cxx
parent15974abe63f0d4fc88099634d5cd2ddb9760ec23 (diff)
Use boost::scoped_ptr to avoid resource leaks in case of exception
Change-Id: I05a17a061bfd4c3dbd15fe80c1f1f4f8d8267ea7
Diffstat (limited to 'sw/source/ui/app/docsh2.cxx')
-rw-r--r--sw/source/ui/app/docsh2.cxx5
1 files changed, 3 insertions, 2 deletions
diff --git a/sw/source/ui/app/docsh2.cxx b/sw/source/ui/app/docsh2.cxx
index 8b83dda57f69..8074f8674f94 100644
--- a/sw/source/ui/app/docsh2.cxx
+++ b/sw/source/ui/app/docsh2.cxx
@@ -113,6 +113,8 @@
#include <ndtxt.hxx>
+#include <boost/scoped_ptr.hpp>
+
using namespace ::com::sun::star::ui::dialogs;
using namespace ::com::sun::star::lang;
using namespace ::com::sun::star::uno;
@@ -682,7 +684,7 @@ void SwDocShell::Execute(SfxRequest& rReq)
SwAbstractDialogFactory* pFact = SwAbstractDialogFactory::Create();
OSL_ENSURE(pFact, "SwAbstractDialogFactory fail!");
- AbstractSwInsertAbstractDlg* pDlg = pFact->CreateSwInsertAbstractDlg(0);
+ boost::scoped_ptr<AbstractSwInsertAbstractDlg> pDlg(pFact->CreateSwInsertAbstractDlg(0));
OSL_ENSURE(pDlg, "Dialogdiet fail!");
if(RET_OK == pDlg->Execute())
{
@@ -749,7 +751,6 @@ void SwDocShell::Execute(SfxRequest& rReq)
}
}
- delete pDlg;
}
break;
case FN_OUTLINE_TO_CLIPBOARD: