[Libreoffice-commits] core.git: extensions/source

Noel Grandin noel.grandin at collabora.co.uk
Wed Oct 18 06:36:29 UTC 2017


 extensions/source/inc/componentmodule.cxx |   11 ++---------
 1 file changed, 2 insertions(+), 9 deletions(-)

New commits:
commit 08f7502bf8a186a7b3d600c3543069ea544cabef
Author: Noel Grandin <noel.grandin at collabora.co.uk>
Date:   Tue Oct 17 15:00:09 2017 +0200

    no need to call acquire()
    
    when we are returning an uno::Reference
    
    Change-Id: Ifff0dba20f45f5321f398577fa7d5fb073278a94
    Reviewed-on: https://gerrit.libreoffice.org/43472
    Tested-by: Jenkins <ci at libreoffice.org>
    Reviewed-by: Noel Grandin <noel.grandin at collabora.co.uk>

diff --git a/extensions/source/inc/componentmodule.cxx b/extensions/source/inc/componentmodule.cxx
index 40273cf879de..5d031a67d1a5 100644
--- a/extensions/source/inc/componentmodule.cxx
+++ b/extensions/source/inc/componentmodule.cxx
@@ -136,9 +136,6 @@ namespace compmodule
             "OModule::getComponentFactory : inconsistent state !");
 
 
-        Reference< XInterface > xReturn;
-
-
         sal_Int32 nLen = s_pImplementationNames->size();
 
         for (sal_Int32 i=0; i<nLen; ++i)
@@ -147,14 +144,10 @@ namespace compmodule
             {
                 const FactoryInstantiation FactoryInstantiationFunction = (*s_pFactoryFunctionPointers)[i];
 
-                xReturn = FactoryInstantiationFunction( _rxServiceManager, _rImplementationName,
+                Reference< XInterface > xReturn = FactoryInstantiationFunction( _rxServiceManager, _rImplementationName,
                     (*s_pCreationFunctionPointers)[i],
                     (*s_pSupportedServices)[i], nullptr);
-                if (xReturn.is())
-                {
-                    xReturn->acquire();
-                    return xReturn.get();
-                }
+                return xReturn;
             }
         }
 


More information about the Libreoffice-commits mailing list