diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2018-01-16 14:51:22 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2018-01-19 08:58:46 +0200 |
commit | 000fa4c4952cdc3d63f91a63eb4b3da83e5990ca (patch) | |
tree | ccf0952ff2c380ed73efccc0daeb3d406f694768 /basic/source | |
parent | 24cbc7a1fc857748dfba31b426f786307b779d48 (diff) |
loplugin:useuniqueptr in SbiStdObject
Change-Id: Ic66d817746de423549c87f58068e47f9942d04fd
Diffstat (limited to 'basic/source')
-rw-r--r-- | basic/source/inc/stdobj.hxx | 2 | ||||
-rw-r--r-- | basic/source/runtime/stdobj.cxx | 8 |
2 files changed, 5 insertions, 5 deletions
diff --git a/basic/source/inc/stdobj.hxx b/basic/source/inc/stdobj.hxx index 12eb8dc31234..d7bc4c176493 100644 --- a/basic/source/inc/stdobj.hxx +++ b/basic/source/inc/stdobj.hxx @@ -27,7 +27,7 @@ class SbStdFactory; class SbiStdObject : public SbxObject { - SbStdFactory* pStdFactory; + std::unique_ptr<SbStdFactory> pStdFactory; virtual ~SbiStdObject() override; using SbxVariable::GetInfo; diff --git a/basic/source/runtime/stdobj.cxx b/basic/source/runtime/stdobj.cxx index 23c00519214b..d6349e0000a0 100644 --- a/basic/source/runtime/stdobj.cxx +++ b/basic/source/runtime/stdobj.cxx @@ -724,16 +724,16 @@ SbiStdObject::SbiStdObject( const OUString& r, StarBASIC* pb ) : SbxObject( r ) SetParent( pb ); - pStdFactory = new SbStdFactory; - SbxBase::AddFactory( pStdFactory ); + pStdFactory.reset( new SbStdFactory ); + SbxBase::AddFactory( pStdFactory.get() ); Insert( new SbStdClipboard ); } SbiStdObject::~SbiStdObject() { - SbxBase::RemoveFactory( pStdFactory ); - delete pStdFactory; + SbxBase::RemoveFactory( pStdFactory.get() ); + pStdFactory.reset(); } // Finding an element: |