summaryrefslogtreecommitdiff
path: root/sw/source/ui/envelp/envprt.cxx
diff options
context:
space:
mode:
authorTakeshi Abe <tabe@fixedpoint.jp>2014-06-04 04:11:15 +0900
committerTakeshi Abe <tabe@fixedpoint.jp>2014-06-04 04:17:18 +0900
commit7883992dd5f8561b6eb192fce864b76c3034b1c5 (patch)
tree7025fcae30913753f8ec86e502bec5d33bb436f3 /sw/source/ui/envelp/envprt.cxx
parentb1a5aedb74d623709c4448b75c250e9fe17b9c28 (diff)
Avoid possible memory leaks in case of exceptions
Change-Id: I45929aae52fa106b5f5c0199f8ce8b60c0ac5438
Diffstat (limited to 'sw/source/ui/envelp/envprt.cxx')
-rw-r--r--sw/source/ui/envelp/envprt.cxx5
1 files changed, 3 insertions, 2 deletions
diff --git a/sw/source/ui/envelp/envprt.cxx b/sw/source/ui/envelp/envprt.cxx
index 6978b0454b36..252cf04ac0d9 100644
--- a/sw/source/ui/envelp/envprt.cxx
+++ b/sw/source/ui/envelp/envprt.cxx
@@ -27,6 +27,7 @@
#include "uitool.hxx"
#include "envprt.hrc"
+#include <boost/scoped_ptr.hpp>
SwEnvPrtPage::SwEnvPrtPage(Window* pParent, const SfxItemSet& rSet)
: SfxTabPage(pParent, "EnvPrinterPage",
@@ -98,10 +99,10 @@ IMPL_LINK( SwEnvPrtPage, ButtonHdl, Button *, pBtn )
// Call printer setup
if (pPrt)
{
- PrinterSetupDialog* pDlg = new PrinterSetupDialog(this );
+ boost::scoped_ptr<PrinterSetupDialog> pDlg(new PrinterSetupDialog(this));
pDlg->SetPrinter(pPrt);
pDlg->Execute();
- delete pDlg;
+ pDlg.reset();
GrabFocus();
m_pPrinterInfo->SetText(pPrt->GetName());
}