diff options
author | Takeshi Abe <tabe@fixedpoint.jp> | 2014-05-19 22:25:31 +0900 |
---|---|---|
committer | Takeshi Abe <tabe@fixedpoint.jp> | 2014-05-19 22:28:31 +0900 |
commit | 018e2f629e125f1a0fe33471a0e4fe606813aa91 (patch) | |
tree | 68e8420ba62a0cb41b32edc766943d9c9249715d /sd/source/ui/func/fucushow.cxx | |
parent | b1aa528721c578767985a1b31f653375f26db076 (diff) |
Avoid possible memory leaks in case of exceptions
Change-Id: I61fe5f5fff157531de9962a2dd4e6e0431e8601c
Diffstat (limited to 'sd/source/ui/func/fucushow.cxx')
-rw-r--r-- | sd/source/ui/func/fucushow.cxx | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/sd/source/ui/func/fucushow.cxx b/sd/source/ui/func/fucushow.cxx index ab1ccd41af32..514520beaf76 100644 --- a/sd/source/ui/func/fucushow.cxx +++ b/sd/source/ui/func/fucushow.cxx @@ -32,6 +32,7 @@ #include <sfx2/viewfrm.hxx> #include "sdabstdlg.hxx" +#include <boost/scoped_ptr.hpp> namespace sd { @@ -59,7 +60,7 @@ rtl::Reference<FuPoor> FuCustomShowDlg::Create( ViewShell* pViewSh, ::sd::Window void FuCustomShowDlg::DoExecute( SfxRequest& ) { SdAbstractDialogFactory* pFact = SdAbstractDialogFactory::Create(); - AbstractSdCustomShowDlg* pDlg = pFact ? pFact->CreateSdCustomShowDlg( NULL, *mpDoc ) : 0; + boost::scoped_ptr<AbstractSdCustomShowDlg> pDlg(pFact ? pFact->CreateSdCustomShowDlg( NULL, *mpDoc ) : 0); if( pDlg ) { sal_uInt16 nRet = pDlg->Execute(); @@ -69,7 +70,7 @@ void FuCustomShowDlg::DoExecute( SfxRequest& ) sd::PresentationSettings& rSettings = mpDoc->getPresentationSettings(); rSettings.mbCustomShow = pDlg->IsCustomShow(); } - delete pDlg; + pDlg.reset(); if( nRet == RET_YES ) { |