diff options
author | Takeshi Abe <tabe@fixedpoint.jp> | 2014-01-23 07:50:33 +0900 |
---|---|---|
committer | Takeshi Abe <tabe@fixedpoint.jp> | 2014-01-23 07:52:38 +0900 |
commit | 8532dbcfa88051104dd6eea73b75147874cdcf4a (patch) | |
tree | ee087520864439ac69dfb9ee8f851d452d55109e /sw/source/ui/dochdl | |
parent | 10eeb38164b79762ab295d72da0f8ba4319b9f69 (diff) |
Avoid possible resource leaks in case of exception
Change-Id: I58d1b270de2fe1d8ffb1867e5c36ab5ebf332ae0
Diffstat (limited to 'sw/source/ui/dochdl')
-rw-r--r-- | sw/source/ui/dochdl/swdtflvr.cxx | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/sw/source/ui/dochdl/swdtflvr.cxx b/sw/source/ui/dochdl/swdtflvr.cxx index d07f2fb02941..326b49296b96 100644 --- a/sw/source/ui/dochdl/swdtflvr.cxx +++ b/sw/source/ui/dochdl/swdtflvr.cxx @@ -835,9 +835,9 @@ int SwTransferable::PrepareForCopy( sal_Bool bIsCut ) else if ( pWrtShell->IsSelection() || pWrtShell->IsFrmSelected() || pWrtShell->IsObjSelected() ) { - SwWait *pWait = 0; + boost::scoped_ptr<SwWait> pWait; if( pWrtShell->ShouldWait() ) - pWait = new SwWait( *pWrtShell->GetView().GetDocShell(), true ); + pWait.reset(new SwWait( *pWrtShell->GetView().GetDocShell(), true )); pClpDocFac = new SwDocFac; @@ -958,8 +958,6 @@ int SwTransferable::PrepareForCopy( sal_Bool bIsCut ) PrepareOLE( aObjDesc ); AddFormat( SOT_FORMATSTR_ID_OBJECTDESCRIPTOR ); - - delete pWait; } else nRet = 0; |