summaryrefslogtreecommitdiff
path: root/basic/source/comp/sbcomp.cxx
diff options
context:
space:
mode:
authorTakeshi Abe <tabe@fixedpoint.jp>2014-05-29 09:27:30 +0900
committerTakeshi Abe <tabe@fixedpoint.jp>2014-05-29 09:29:15 +0900
commita71ae24a236aa7bf6c17cad92a1662e63b7a13bf (patch)
tree64a0298f173c4b05f525e1288d9c28fa563dc899 /basic/source/comp/sbcomp.cxx
parent7c8b2f10310f0f64b111afb3012e82e9c4a690ac (diff)
Avoid possible memory leaks in case of exceptions
Change-Id: Iac63a5d60478e5cd8e2b77c889c7b312d3d15f67
Diffstat (limited to 'basic/source/comp/sbcomp.cxx')
-rw-r--r--basic/source/comp/sbcomp.cxx5
1 files changed, 3 insertions, 2 deletions
diff --git a/basic/source/comp/sbcomp.cxx b/basic/source/comp/sbcomp.cxx
index e3f49e74eebb..59b0fd7457e8 100644
--- a/basic/source/comp/sbcomp.cxx
+++ b/basic/source/comp/sbcomp.cxx
@@ -24,6 +24,7 @@
#include "sbobjmod.hxx"
#include <svtools/miscopt.hxx>
#include <stdio.h>
+#include <boost/scoped_ptr.hpp>
// To activate tracing enable in sbtrace.hxx
#ifdef DBG_TRACE_BASIC
@@ -954,11 +955,11 @@ bool SbModule::Compile()
SbModule* pOld = GetSbData()->pCompMod;
GetSbData()->pCompMod = this;
- SbiParser* pParser = new SbiParser( (StarBASIC*) GetParent(), this );
+ boost::scoped_ptr<SbiParser> pParser(new SbiParser( (StarBASIC*) GetParent(), this ));
while( pParser->Parse() ) {}
if( !pParser->GetErrors() )
pParser->aGen.Save();
- delete pParser;
+ pParser.reset();
// for the disassembler
if( pImage )
pImage->aOUSource = aOUSource;