diff options
Diffstat (limited to 'basic/source/comp/codegen.cxx')
-rw-r--r-- | basic/source/comp/codegen.cxx | 8 |
1 files changed, 2 insertions, 6 deletions
diff --git a/basic/source/comp/codegen.cxx b/basic/source/comp/codegen.cxx index 565fafe6c079..3442202a8ba1 100644 --- a/basic/source/comp/codegen.cxx +++ b/basic/source/comp/codegen.cxx @@ -139,7 +139,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; @@ -385,11 +385,7 @@ void SbiCodeGen::Save() } if( !p->IsError() ) { - rMod.pImage = p; - } - else - { - delete p; + rMod.pImage = std::move(p); } rMod.EndDefinitions(); } |