[Libreoffice-commits] core.git: comphelper/source include/comphelper

Xisco Fauli anistenis at gmail.com
Thu Jun 2 06:33:51 UTC 2016


 comphelper/source/misc/componentmodule.cxx |   14 --------------
 include/comphelper/componentmodule.hxx     |    3 ++-
 2 files changed, 2 insertions(+), 15 deletions(-)

New commits:
commit e0f60043cc6013eabd22dc73f7371a4f19f54625
Author: Xisco Fauli <anistenis at gmail.com>
Date:   Wed Jun 1 01:23:34 2016 +0200

    tdf#89329: use unique_ptr for pImpl in componentmodule
    
    Change-Id: Ida8e271b1dd755289371e457a7c83657b8a84f99
    Reviewed-on: https://gerrit.libreoffice.org/25746
    Tested-by: Jenkins <ci at libreoffice.org>
    Reviewed-by: Noel Grandin <noelgrandin at gmail.com>

diff --git a/comphelper/source/misc/componentmodule.cxx b/comphelper/source/misc/componentmodule.cxx
index fede3e2..074515e 100644
--- a/comphelper/source/misc/componentmodule.cxx
+++ b/comphelper/source/misc/componentmodule.cxx
@@ -24,11 +24,9 @@
 
 #include <vector>
 
-
 namespace comphelper
 {
 
-
     using namespace ::cppu;
     using ::com::sun::star::uno::Sequence;
     using ::com::sun::star::uno::RuntimeException;
@@ -48,12 +46,10 @@ namespace comphelper
         ~OModuleImpl();
     };
 
-
     OModuleImpl::OModuleImpl()
     {
     }
 
-
     OModuleImpl::~OModuleImpl()
     {
     }
@@ -66,16 +62,13 @@ namespace comphelper
 
     OModule::~OModule()
     {
-        delete m_pImpl;
     }
 
-
     void OModule::registerClient( OModule::ClientAccess )
     {
         osl_atomic_increment( &m_nClients );
     }
 
-
     void OModule::revokeClient( OModule::ClientAccess )
     {
         if ( 0 == osl_atomic_decrement( &m_nClients ) )
@@ -85,12 +78,10 @@ namespace comphelper
         }
     }
 
-
     void OModule::onLastClient()
     {
     }
 
-
     void OModule::registerImplementation( const ComponentDescription& _rComp )
     {
         ::osl::MutexGuard aGuard( m_aMutex );
@@ -100,7 +91,6 @@ namespace comphelper
         m_pImpl->m_aRegisteredComponents.push_back( _rComp );
     }
 
-
     void OModule::registerImplementation( const OUString& _rImplementationName, const css::uno::Sequence< OUString >& _rServiceNames,
         ::cppu::ComponentFactoryFunc _pCreateFunction )
     {
@@ -108,7 +98,6 @@ namespace comphelper
         registerImplementation( aComponent );
     }
 
-
     void* OModule::getComponentFactory( const sal_Char* _pImplementationName )
     {
         Reference< XInterface > xFactory( getComponentFactory(
@@ -116,7 +105,6 @@ namespace comphelper
         return xFactory.get();
     }
 
-
     Reference< XInterface > OModule::getComponentFactory( const OUString& _rImplementationName )
     {
         Reference< XInterface > xReturn;
@@ -145,8 +133,6 @@ namespace comphelper
         return nullptr;
     }
 
-
 } // namespace comphelper
 
-
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/comphelper/componentmodule.hxx b/include/comphelper/componentmodule.hxx
index 2357055..05626eb 100644
--- a/include/comphelper/componentmodule.hxx
+++ b/include/comphelper/componentmodule.hxx
@@ -30,6 +30,7 @@
 
 #include <rtl/string.hxx>
 #include <rtl/instance.hxx>
+#include <memory>
 
 
 namespace comphelper
@@ -82,7 +83,7 @@ namespace comphelper
     {
     private:
         oslInterlockedCount     m_nClients;     /// number of registered clients
-        OModuleImpl*            m_pImpl;        /// impl class. lives as long as at least one client for the module is registered
+        std::unique_ptr<OModuleImpl>            m_pImpl;        /// impl class. lives as long as at least one client for the module is registered
 
     protected:
         mutable ::osl::Mutex    m_aMutex;       /// access safety


More information about the Libreoffice-commits mailing list