summaryrefslogtreecommitdiff
path: root/basic
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2018-12-11 09:11:14 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2018-12-12 07:28:49 +0100
commit30eb0839c59d8066d130ea3f25b605d9f6276eb9 (patch)
tree18120e42d9bd8528612b273c68155aaaa886a4cc /basic
parentd398e9248c183cf988b6d985b342b0cbff93ea02 (diff)
loplugin:useuniqueptr in basic and framework
Change-Id: I409c9c572eb8f3d68c8a387844b43988b4ab5c32 Reviewed-on: https://gerrit.libreoffice.org/64949 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'basic')
-rw-r--r--basic/source/classes/sbxmod.cxx12
1 files changed, 6 insertions, 6 deletions
diff --git a/basic/source/classes/sbxmod.cxx b/basic/source/classes/sbxmod.cxx
index db86e597b12b..69343b6d7552 100644
--- a/basic/source/classes/sbxmod.cxx
+++ b/basic/source/classes/sbxmod.cxx
@@ -1105,12 +1105,12 @@ void SbModule::Run( SbMethod* pMeth )
SbModule* pOldMod = GetSbData()->pMod;
GetSbData()->pMod = this;
- SbiRuntime* pRt = new SbiRuntime( this, pMeth, pMeth->nStart );
+ std::unique_ptr<SbiRuntime> pRt(new SbiRuntime( this, pMeth, pMeth->nStart ));
pRt->pNext = GetSbData()->pInst->pRun;
if( pRt->pNext )
pRt->pNext->block();
- GetSbData()->pInst->pRun = pRt;
+ GetSbData()->pInst->pRun = pRt.get();
if ( mbVBACompat )
{
GetSbData()->pInst->EnableCompatibility( true );
@@ -1144,7 +1144,7 @@ void SbModule::Run( SbMethod* pMeth )
if( pRtNext && (pRt->GetDebugFlags() & BasicDebugFlags::Break) )
pRtNext->SetDebugFlags( BasicDebugFlags::Break );
- delete pRt;
+ pRt.reset();
GetSbData()->pMod = pOldMod;
if( bDelInst )
{
@@ -1223,14 +1223,14 @@ void SbModule::RunInit()
SbModule* pOldMod = GetSbData()->pMod;
GetSbData()->pMod = this;
// The init code starts always here
- SbiRuntime* pRt = new SbiRuntime( this, nullptr, 0 );
+ std::unique_ptr<SbiRuntime> pRt(new SbiRuntime( this, nullptr, 0 ));
pRt->pNext = GetSbData()->pInst->pRun;
- GetSbData()->pInst->pRun = pRt;
+ GetSbData()->pInst->pRun = pRt.get();
while( pRt->Step() ) {}
GetSbData()->pInst->pRun = pRt->pNext;
- delete pRt;
+ pRt.reset();
GetSbData()->pMod = pOldMod;
pImage->bInit = true;
pImage->bFirstInit = false;