summaryrefslogtreecommitdiffstats
path: root/basic/source/comp/codegen.cxx
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2018-01-16 14:41:21 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2018-01-19 08:58:46 +0200
commit263d7325691f4b0a1bda155f1c53bbcf712e9f09 (patch)
tree024ca8d5fd98d09053faa6c4b22afb91098890d2 /basic/source/comp/codegen.cxx
parentloplugin:useuniqueptr in EMFPBrush (diff)
downloadcore-263d7325691f4b0a1bda155f1c53bbcf712e9f09.tar.gz
core-263d7325691f4b0a1bda155f1c53bbcf712e9f09.zip
loplugin:useuniqueptr in SbModule
Change-Id: I20525bd69c91ff35c9e569525a0d4556bc184982
Diffstat (limited to 'basic/source/comp/codegen.cxx')
-rw-r--r--basic/source/comp/codegen.cxx10
1 files changed, 3 insertions, 7 deletions
diff --git a/basic/source/comp/codegen.cxx b/basic/source/comp/codegen.cxx
index aa587ba0e5b5..8b7a0a8142e4 100644
--- a/basic/source/comp/codegen.cxx
+++ b/basic/source/comp/codegen.cxx
@@ -133,7 +133,7 @@ void SbiCodeGen::Save()
if( pParser->IsCodeCompleting() )
return;
- SbiImage* p = new SbiImage;
+ std::unique_ptr<SbiImage> p( new SbiImage );
rMod.StartDefinitions();
// OPTION BASE-Value:
p->nDimBase = pParser->nBase;
@@ -150,7 +150,7 @@ void SbiCodeGen::Save()
nIfaceCount = pParser->aIfaceVector.size();
if( !rMod.pClassData )
- rMod.pClassData = new SbClassData;
+ rMod.pClassData.reset( new SbClassData );
if( nIfaceCount )
{
for( int i = 0 ; i < nIfaceCount ; i++ )
@@ -375,11 +375,7 @@ void SbiCodeGen::Save()
}
if( !p->IsError() )
{
- rMod.pImage = p;
- }
- else
- {
- delete p;
+ rMod.pImage = std::move(p);
}
rMod.EndDefinitions();
}