summaryrefslogtreecommitdiff
path: root/basic/source/classes
diff options
context:
space:
mode:
authorNoel <noel.grandin@collabora.co.uk>2021-02-22 12:12:37 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2021-02-22 17:32:28 +0100
commit1571fd8bfdb1deb07b4d6a4abde4919d24550cea (patch)
tree948935177a86650075924356270c032281917900 /basic/source/classes
parentdc37866f3266f92c71bb4b3cec2b869069230c28 (diff)
loplugin:refcounting in basic
Change-Id: I0c1e41436ddae176695a90c120303727aa3bc2ad Reviewed-on: https://gerrit.libreoffice.org/c/core/+/111306 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'basic/source/classes')
-rw-r--r--basic/source/classes/sbunoobj.cxx9
1 files changed, 4 insertions, 5 deletions
diff --git a/basic/source/classes/sbunoobj.cxx b/basic/source/classes/sbunoobj.cxx
index 2afc7ed52604..259cd5ae88f4 100644
--- a/basic/source/classes/sbunoobj.cxx
+++ b/basic/source/classes/sbunoobj.cxx
@@ -4048,8 +4048,7 @@ void SbRtl_CreateUnoListener(StarBASIC * pBasic, SbxArray & rPar, bool)
Reference< XInvocationAdapterFactory2 > xInvocationAdapterFactory =
InvocationAdapterFactory::create( xContext );
- BasicAllListener_Impl * p;
- Reference< XAllListener > xAllLst = p = new BasicAllListener_Impl( aPrefixName );
+ rtl::Reference<BasicAllListener_Impl> xAllLst = new BasicAllListener_Impl( aPrefixName );
Any aTmp;
Reference< XInterface > xLst = createAllListenerAdapter( xInvocationAdapterFactory, xClass, xAllLst, aTmp );
if( !xLst.is() )
@@ -4062,8 +4061,8 @@ void SbRtl_CreateUnoListener(StarBASIC * pBasic, SbxArray & rPar, bool)
return;
SbUnoObject* pUnoObj = new SbUnoObject( aListenerClassName, aTmp );
- p->xSbxObj = pUnoObj;
- p->xSbxObj->SetParent( pBasic );
+ xAllLst->xSbxObj = pUnoObj;
+ xAllLst->xSbxObj->SetParent( pBasic );
// #100326 Register listener object to set Parent NULL in Dtor
SbxArrayRef xBasicUnoListeners = pBasic->getUnoListeners();
@@ -4071,7 +4070,7 @@ void SbRtl_CreateUnoListener(StarBASIC * pBasic, SbxArray & rPar, bool)
// return the object
SbxVariableRef refVar = rPar.Get32(0);
- refVar->PutObject( p->xSbxObj.get() );
+ refVar->PutObject( xAllLst->xSbxObj.get() );
}