[Libreoffice-commits] core.git: compilerplugins/clang connectivity/inc connectivity/source include/connectivity mysqlc/source

Noel Grandin noel.grandin at collabora.co.uk
Fri Feb 2 10:22:06 UTC 2018


 compilerplugins/clang/weakobject.cxx                         |    4 
 connectivity/inc/pch/precompiled_dbtools.hxx                 |    1 
 connectivity/source/commontools/dbtools.cxx                  |   43 -----
 connectivity/source/drivers/ado/AConnection.cxx              |   10 -
 connectivity/source/drivers/ado/AStatement.cxx               |    4 
 connectivity/source/drivers/evoab2/NConnection.cxx           |    9 -
 connectivity/source/drivers/evoab2/NConnection.hxx           |    6 
 connectivity/source/drivers/evoab2/NResultSet.hxx            |    1 
 connectivity/source/drivers/evoab2/NStatement.cxx            |    4 
 connectivity/source/drivers/evoab2/NStatement.hxx            |    7 
 connectivity/source/drivers/file/FConnection.cxx             |   11 -
 connectivity/source/drivers/file/FStatement.cxx              |    4 
 connectivity/source/drivers/firebird/Connection.cxx          |    7 
 connectivity/source/drivers/firebird/Connection.hxx          |    8 
 connectivity/source/drivers/firebird/ResultSet.hxx           |    1 
 connectivity/source/drivers/firebird/StatementCommonBase.hxx |    1 
 connectivity/source/drivers/jdbc/JConnection.cxx             |    7 
 connectivity/source/drivers/jdbc/JStatement.cxx              |    7 
 connectivity/source/drivers/macab/MacabConnection.cxx        |   11 -
 connectivity/source/drivers/macab/MacabConnection.hxx        |   10 -
 connectivity/source/drivers/mork/MConnection.cxx             |   10 -
 connectivity/source/drivers/mork/MConnection.hxx             |    8 
 connectivity/source/drivers/mork/MStatement.cxx              |    4 
 connectivity/source/drivers/mork/MStatement.hxx              |    4 
 connectivity/source/drivers/odbc/OConnection.cxx             |   10 -
 connectivity/source/drivers/odbc/OStatement.cxx              |    9 -
 connectivity/source/inc/ado/AConnection.hxx                  |    8 
 connectivity/source/inc/ado/AStatement.hxx                   |    4 
 connectivity/source/inc/file/FConnection.hxx                 |    9 -
 connectivity/source/inc/file/FStatement.hxx                  |    8 
 connectivity/source/inc/java/sql/Connection.hxx              |    5 
 connectivity/source/inc/java/sql/JStatement.hxx              |   10 -
 connectivity/source/inc/odbc/OConnection.hxx                 |    6 
 connectivity/source/inc/odbc/OStatement.hxx                  |   13 -
 connectivity/source/sdbcx/VCatalog.cxx                       |    8 
 include/connectivity/OSubComponent.hxx                       |   89 -----------
 include/connectivity/sdbcx/VCatalog.hxx                      |    7 
 mysqlc/source/mysqlc_connection.cxx                          |    8 
 mysqlc/source/mysqlc_connection.hxx                          |    8 
 mysqlc/source/mysqlc_statement.cxx                           |    4 
 mysqlc/source/mysqlc_statement.hxx                           |    7 
 mysqlc/source/mysqlc_subcomponent.hxx                        |   33 ----
 42 files changed, 29 insertions(+), 399 deletions(-)

New commits:
commit 1b67ad6ff8979d8851db1223886bb03745845755
Author: Noel Grandin <noel.grandin at collabora.co.uk>
Date:   Thu Feb 1 13:54:31 2018 +0200

    remove connectivity OSubComponent
    
    push the logic that is still necessary down into the subclasses
    
    Change-Id: I99424f0b3c654c5652991a4140b17ceb02224e50
    Reviewed-on: https://gerrit.libreoffice.org/49087
    Tested-by: Jenkins <ci at libreoffice.org>
    Reviewed-by: Noel Grandin <noel.grandin at collabora.co.uk>

diff --git a/compilerplugins/clang/weakobject.cxx b/compilerplugins/clang/weakobject.cxx
index 13144f541d82..70e81baa411a 100644
--- a/compilerplugins/clang/weakobject.cxx
+++ b/compilerplugins/clang/weakobject.cxx
@@ -126,10 +126,6 @@ public:
                         return true;
                     }
                 }
-                else if (pCalled->getName() == "release_ChildImpl") // FIXME remove this lunacy
-                {
-                    return true;
-                }
             }
         }
 
diff --git a/connectivity/inc/pch/precompiled_dbtools.hxx b/connectivity/inc/pch/precompiled_dbtools.hxx
index d968127a3d25..72566e24a030 100644
--- a/connectivity/inc/pch/precompiled_dbtools.hxx
+++ b/connectivity/inc/pch/precompiled_dbtools.hxx
@@ -165,7 +165,6 @@
 #include <connectivity/DriversConfig.hxx>
 #include <connectivity/FValue.hxx>
 #include <connectivity/IParseContext.hxx>
-#include <connectivity/OSubComponent.hxx>
 #include <connectivity/PColumn.hxx>
 #include <connectivity/ParameterCont.hxx>
 #include <connectivity/TIndex.hxx>
diff --git a/connectivity/source/commontools/dbtools.cxx b/connectivity/source/commontools/dbtools.cxx
index daca0a341c63..834c7ba9aeda 100644
--- a/connectivity/source/commontools/dbtools.cxx
+++ b/connectivity/source/commontools/dbtools.cxx
@@ -81,7 +81,6 @@
 #include <cppuhelper/implbase.hxx>
 #include <strings.hrc>
 #include <resource/sharedresources.hxx>
-#include <connectivity/OSubComponent.hxx>
 
 #include <algorithm>
 #include <iterator>
@@ -1944,48 +1943,6 @@ void getBooleanComparisonPredicate( const OUString& _rExpression, const bool _bV
 
 namespace connectivity
 {
-void release(oslInterlockedCount& _refCount,
-             ::cppu::OBroadcastHelper& rBHelper,
-             Reference< XInterface >& _xInterface,
-             css::lang::XComponent* _pObject) throw ()
-{
-    if (osl_atomic_decrement( &_refCount ) == 0)
-    {
-        osl_atomic_increment( &_refCount );
-
-        if (!rBHelper.bDisposed && !rBHelper.bInDispose)
-        {
-            // remember the parent
-            Reference< XInterface > xParent;
-            {
-                ::osl::MutexGuard aGuard( rBHelper.rMutex );
-                xParent = _xInterface;
-                _xInterface = nullptr;
-            }
-
-            // First dispose
-            try {
-                _pObject->dispose();
-            } catch (css::uno::RuntimeException & e) {
-                SAL_WARN(
-                    "connectivity.commontools", "Caught exception during dispose, " << e);
-            }
-
-            // only the alive ref holds the object
-            OSL_ASSERT( _refCount == 1 );
-
-            // release the parent in the ~
-            if (xParent.is())
-            {
-                ::osl::MutexGuard aGuard( rBHelper.rMutex );
-                _xInterface = xParent;
-            }
-        }
-    }
-    else
-        osl_atomic_increment( &_refCount );
-}
-
 void checkDisposed(bool _bThrow)
 {
     if (_bThrow)
diff --git a/connectivity/source/drivers/ado/AConnection.cxx b/connectivity/source/drivers/ado/AConnection.cxx
index ad02964b85e3..049989f44786 100644
--- a/connectivity/source/drivers/ado/AConnection.cxx
+++ b/connectivity/source/drivers/ado/AConnection.cxx
@@ -45,8 +45,7 @@ using namespace com::sun::star::sdbcx;
 IMPLEMENT_SERVICE_INFO(OConnection,"com.sun.star.sdbcx.AConnection","com.sun.star.sdbc.Connection");
 
 OConnection::OConnection(ODriver*   _pDriver)
-                         : OSubComponent<OConnection, OConnection_BASE>(static_cast<cppu::OWeakObject*>(_pDriver), this),
-                         m_xCatalog(nullptr),
+                         : m_xCatalog(nullptr),
                          m_pDriver(_pDriver),
                          m_pAdoConnection(nullptr),
                          m_pCatalog(nullptr),
@@ -153,11 +152,6 @@ void OConnection::construct(const OUString& url,const Sequence< PropertyValue >&
     osl_atomic_decrement( &m_refCount );
 }
 
-void SAL_CALL OConnection::release() throw()
-{
-    release_ChildImpl();
-}
-
 Reference< XStatement > SAL_CALL OConnection::createStatement(  )
 {
     ::osl::MutexGuard aGuard( m_aMutex );
@@ -490,8 +484,6 @@ void OConnection::disposing()
 
     delete m_pAdoConnection;
     m_pAdoConnection = nullptr;
-
-    dispose_ChildImpl();
 }
 
 sal_Int64 SAL_CALL OConnection::getSomething( const css::uno::Sequence< sal_Int8 >& rId )
diff --git a/connectivity/source/drivers/ado/AStatement.cxx b/connectivity/source/drivers/ado/AStatement.cxx
index 5bdf386468c4..f2ed68a78070 100644
--- a/connectivity/source/drivers/ado/AStatement.cxx
+++ b/connectivity/source/drivers/ado/AStatement.cxx
@@ -53,7 +53,6 @@ using namespace ::std;
 
 OStatement_Base::OStatement_Base(OConnection* _pConnection ) :  OStatement_BASE(m_aMutex)
                                                         ,OPropertySetHelper(OStatement_BASE::rBHelper)
-                                                        ,OSubComponent<OStatement_Base, OStatement_BASE>(static_cast<cppu::OWeakObject*>(_pConnection), this)
                                                         ,m_pConnection(_pConnection)
                                                         ,m_nMaxRows(0)
                                                         ,m_nFetchSize(1)
@@ -104,13 +103,12 @@ void OStatement_Base::disposing()
     if (m_pConnection)
         m_pConnection->release();
 
-    dispose_ChildImpl();
     OStatement_BASE::disposing();
 }
 
 void SAL_CALL OStatement_Base::release() throw()
 {
-    release_ChildImpl();
+    OStatement_BASE::release();
 }
 
 Any SAL_CALL OStatement_Base::queryInterface( const Type & rType )
diff --git a/connectivity/source/drivers/evoab2/NConnection.cxx b/connectivity/source/drivers/evoab2/NConnection.cxx
index fa6fd275e5b6..2971992b9dc1 100644
--- a/connectivity/source/drivers/evoab2/NConnection.cxx
+++ b/connectivity/source/drivers/evoab2/NConnection.cxx
@@ -41,8 +41,7 @@ using namespace ::com::sun::star::sdbc;
 using namespace ::com::sun::star::lang;
 
 OEvoabConnection::OEvoabConnection(OEvoabDriver& _rDriver)
-    : OSubComponent<OEvoabConnection, OConnection_BASE>( static_cast<cppu::OWeakObject*>(&_rDriver), this )
-    , m_rDriver(_rDriver)
+    : m_rDriver(_rDriver)
     , m_eSDBCAddressType(SDBCAddress::EVO_LOCAL)
     , m_xCatalog(nullptr)
 {
@@ -59,11 +58,6 @@ OEvoabConnection::~OEvoabConnection()
 }
 
 
-void SAL_CALL OEvoabConnection::release() throw()
-{
-    release_ChildImpl();
-}
-
 // XServiceInfo
 
 IMPLEMENT_SERVICE_INFO(OEvoabConnection, "com.sun.star.sdbc.drivers.evoab.Connection", "com.sun.star.sdbc.Connection")
@@ -198,7 +192,6 @@ void OEvoabConnection::disposing()
     // we noticed that we should be destroyed in near future so we have to dispose our statements
     ::osl::MutexGuard aGuard(m_aMutex);
     OConnection_BASE::disposing();
-    dispose_ChildImpl();
 }
 
 // -------------------------------- stubbed methods ------------------------------------------------
diff --git a/connectivity/source/drivers/evoab2/NConnection.hxx b/connectivity/source/drivers/evoab2/NConnection.hxx
index 3156985020ae..b7860bce0a3d 100644
--- a/connectivity/source/drivers/evoab2/NConnection.hxx
+++ b/connectivity/source/drivers/evoab2/NConnection.hxx
@@ -23,7 +23,6 @@
 #include "NDriver.hxx"
 #include <com/sun/star/sdbc/SQLWarning.hpp>
 #include <com/sun/star/beans/PropertyValue.hpp>
-#include <connectivity/OSubComponent.hxx>
 #include <com/sun/star/sdbcx/XTablesSupplier.hpp>
 #include <connectivity/CommonTools.hxx>
 #include <connectivity/warningscontainer.hxx>
@@ -49,10 +48,7 @@ namespace connectivity
         typedef connectivity::OMetaConnection               OConnection_BASE; // implements basics and text encoding
 
         class OEvoabConnection  :public OConnection_BASE
-                                ,public connectivity::OSubComponent<OEvoabConnection, OConnection_BASE>
         {
-            friend class connectivity::OSubComponent<OEvoabConnection, OConnection_BASE>;
-
         private:
             const OEvoabDriver&             m_rDriver;
             SDBCAddress::sdbc_address_type  m_eSDBCAddressType;
@@ -78,8 +74,6 @@ namespace connectivity
 
             // OComponentHelper
             virtual void SAL_CALL disposing() override;
-            // XInterface
-            virtual void SAL_CALL release() throw() override;
 
             // XServiceInfo
             DECLARE_SERVICE_INFO();
diff --git a/connectivity/source/drivers/evoab2/NResultSet.hxx b/connectivity/source/drivers/evoab2/NResultSet.hxx
index f1128a77bd7b..40b0027cfe48 100644
--- a/connectivity/source/drivers/evoab2/NResultSet.hxx
+++ b/connectivity/source/drivers/evoab2/NResultSet.hxx
@@ -40,7 +40,6 @@
 #include <connectivity/FValue.hxx>
 #include <connectivity/warningscontainer.hxx>
 #include "NStatement.hxx"
-#include <connectivity/OSubComponent.hxx>
 #include "NResultSetMetaData.hxx"
 
 namespace connectivity
diff --git a/connectivity/source/drivers/evoab2/NStatement.cxx b/connectivity/source/drivers/evoab2/NStatement.cxx
index 17643d55f045..d21f41c10e56 100644
--- a/connectivity/source/drivers/evoab2/NStatement.cxx
+++ b/connectivity/source/drivers/evoab2/NStatement.cxx
@@ -70,7 +70,6 @@ EBookQuery * createTest( const OUString &aColumnName,
 OCommonStatement::OCommonStatement(OEvoabConnection* _pConnection)
     : OCommonStatement_IBase(m_aMutex)
     , ::comphelper::OPropertyContainer(OCommonStatement_IBase::rBHelper)
-    , OStatement_CBase( static_cast<cppu::OWeakObject*>(_pConnection), this )
     , m_xResultSet(nullptr)
     , m_xConnection(_pConnection)
     , m_aParser(_pConnection->getDriver().getComponentContext())
@@ -126,7 +125,6 @@ void OCommonStatement::disposing()
 
     m_xConnection.clear();
 
-    dispose_ChildImpl();
     OCommonStatement_IBase::disposing();
 }
 
@@ -532,7 +530,7 @@ void SAL_CALL OCommonStatement::acquire() throw()
 
 void SAL_CALL OCommonStatement::release() throw()
 {
-    release_ChildImpl();
+    OCommonStatement_IBase::release();
 }
 
 
diff --git a/connectivity/source/drivers/evoab2/NStatement.hxx b/connectivity/source/drivers/evoab2/NStatement.hxx
index 65938fe47c9f..a2f918af0b9b 100644
--- a/connectivity/source/drivers/evoab2/NStatement.hxx
+++ b/connectivity/source/drivers/evoab2/NStatement.hxx
@@ -34,7 +34,6 @@
 #include <connectivity/sqliterator.hxx>
 #include <connectivity/sqlparse.hxx>
 #include <connectivity/FValue.hxx>
-#include <connectivity/OSubComponent.hxx>
 #include <com/sun/star/util/XCancellable.hpp>
 #include <cppuhelper/compbase.hxx>
 #include <comphelper/propertycontainer.hxx>
@@ -147,17 +146,11 @@ namespace connectivity
         //************ Class: OCommonStatement
         // is a base class for the normal statement and for the prepared statement
 
-        class OCommonStatement;
-        typedef OSubComponent< OCommonStatement, OCommonStatement_IBase >   OStatement_CBase;
-
         class OCommonStatement  :public cppu::BaseMutex
                                 ,public OCommonStatement_IBase
                                 ,public ::comphelper::OPropertyContainer
                                 ,public ::comphelper::OPropertyArrayUsageHelper< OCommonStatement >
-                                ,public OStatement_CBase
         {
-            friend class OSubComponent< OCommonStatement, OCommonStatement_IBase >;
-
         private:
             css::uno::WeakReference< css::sdbc::XResultSet>    m_xResultSet;   // The last ResultSet created
             rtl::Reference<OEvoabConnection>      m_xConnection;
diff --git a/connectivity/source/drivers/file/FConnection.cxx b/connectivity/source/drivers/file/FConnection.cxx
index ba5822a9696c..8012a33b31ed 100644
--- a/connectivity/source/drivers/file/FConnection.cxx
+++ b/connectivity/source/drivers/file/FConnection.cxx
@@ -56,8 +56,7 @@ using namespace ::ucbhelper;
 typedef connectivity::OMetaConnection OConnection_BASE;
 
 OConnection::OConnection(OFileDriver*   _pDriver)
-    : OSubComponent<OConnection, OConnection_BASE>(static_cast<cppu::OWeakObject*>(_pDriver), this)
-    , m_pDriver(_pDriver)
+    : m_pDriver(_pDriver)
     , m_bAutoCommit(false)
     , m_bReadOnly(false)
     , m_bShowDeleted(false)
@@ -74,12 +73,6 @@ OConnection::~OConnection()
         close();
 }
 
-void SAL_CALL OConnection::release() throw()
-{
-    release_ChildImpl();
-}
-
-
 bool OConnection::matchesExtension( const OUString& _rExt ) const
 {
     if ( isCaseSensitiveExtension() )
@@ -371,8 +364,6 @@ void OConnection::disposing()
     m_xDir.clear();
     m_xContent.clear();
     m_xCatalog  = WeakReference< XTablesSupplier>();
-
-    dispose_ChildImpl();
 }
 
 Reference< XTablesSupplier > OConnection::createCatalog()
diff --git a/connectivity/source/drivers/file/FStatement.cxx b/connectivity/source/drivers/file/FStatement.cxx
index e0ed9a16c35e..8c4c8bc2988e 100644
--- a/connectivity/source/drivers/file/FStatement.cxx
+++ b/connectivity/source/drivers/file/FStatement.cxx
@@ -122,8 +122,6 @@ void OStatement_BASE2::disposing()
 
     m_pConnection.clear();
 
-    dispose_ChildImpl();
-
     if ( m_pParseTree )
     {
         delete m_pParseTree;
@@ -140,7 +138,7 @@ void SAL_CALL OStatement_Base::acquire() throw()
 
 void SAL_CALL OStatement_BASE2::release() throw()
 {
-    release_ChildImpl();
+    OStatement_BASE::release();
 }
 
 Any SAL_CALL OStatement_Base::queryInterface( const Type & rType )
diff --git a/connectivity/source/drivers/firebird/Connection.cxx b/connectivity/source/drivers/firebird/Connection.cxx
index 9cb9fc340cc8..3c4ba3522020 100644
--- a/connectivity/source/drivers/firebird/Connection.cxx
+++ b/connectivity/source/drivers/firebird/Connection.cxx
@@ -83,7 +83,6 @@ static const OUStringLiteral our_sFBKLocation( "firebird.fbk" );
 
 Connection::Connection(FirebirdDriver*    _pDriver)
     : Connection_BASE(m_aMutex)
-    , OSubComponent<Connection, Connection_BASE>(static_cast<cppu::OWeakObject*>(_pDriver), this)
     , m_xDriver(_pDriver)
     , m_sConnectionURL()
     , m_sFirebirdURL()
@@ -112,11 +111,6 @@ Connection::~Connection()
         close();
 }
 
-void SAL_CALL Connection::release() throw()
-{
-    release_ChildImpl();
-}
-
 struct ConnectionGuard
 {
     oslInterlockedCount& m_refCount;
@@ -928,7 +922,6 @@ void Connection::disposing()
     }
     // TODO: write to storage again?
 
-    dispose_ChildImpl();
     cppu::WeakComponentImplHelperBase::disposing();
     m_xDriver.clear();
 
diff --git a/connectivity/source/drivers/firebird/Connection.hxx b/connectivity/source/drivers/firebird/Connection.hxx
index e3c69e7e99c7..8f84b3f00113 100644
--- a/connectivity/source/drivers/firebird/Connection.hxx
+++ b/connectivity/source/drivers/firebird/Connection.hxx
@@ -27,7 +27,6 @@
 #include <ibase.h>
 
 #include <connectivity/CommonTools.hxx>
-#include <connectivity/OSubComponent.hxx>
 #include <cppuhelper/compbase.hxx>
 #include <cppuhelper/weakref.hxx>
 #include <map>
@@ -67,11 +66,8 @@ namespace connectivity
         typedef std::vector< ::connectivity::OTypeInfo>   TTypeInfoVector;
         typedef std::vector< css::uno::WeakReferenceHelper > OWeakRefArray;
 
-        class Connection : public Connection_BASE,
-                            public connectivity::OSubComponent<Connection, Connection_BASE>
+        class Connection : public Connection_BASE
         {
-            friend class connectivity::OSubComponent<Connection, Connection_BASE>;
-
             ::osl::Mutex        m_aMutex;
 
             TTypeInfoVector     m_aTypeInfo;    //  vector containing an entry
@@ -218,8 +214,6 @@ namespace connectivity
 
             // OComponentHelper
             virtual void SAL_CALL disposing() override;
-            // XInterface
-            virtual void SAL_CALL release() throw() override;
 
             // XServiceInfo
             DECLARE_SERVICE_INFO();
diff --git a/connectivity/source/drivers/firebird/ResultSet.hxx b/connectivity/source/drivers/firebird/ResultSet.hxx
index aa7d2083c762..f6aac2e1dc1f 100644
--- a/connectivity/source/drivers/firebird/ResultSet.hxx
+++ b/connectivity/source/drivers/firebird/ResultSet.hxx
@@ -25,7 +25,6 @@
 #include <ibase.h>
 
 #include <connectivity/FValue.hxx>
-#include <connectivity/OSubComponent.hxx>
 #include <cppuhelper/compbase.hxx>
 #include <comphelper/proparrhlp.hxx>
 #include <comphelper/propertycontainer.hxx>
diff --git a/connectivity/source/drivers/firebird/StatementCommonBase.hxx b/connectivity/source/drivers/firebird/StatementCommonBase.hxx
index 856ebc807ff9..a127d42dfd09 100644
--- a/connectivity/source/drivers/firebird/StatementCommonBase.hxx
+++ b/connectivity/source/drivers/firebird/StatementCommonBase.hxx
@@ -24,7 +24,6 @@
 
 #include <ibase.h>
 
-#include <connectivity/OSubComponent.hxx>
 #include <cppuhelper/compbase.hxx>
 #include <list>
 
diff --git a/connectivity/source/drivers/jdbc/JConnection.cxx b/connectivity/source/drivers/jdbc/JConnection.cxx
index 9ccc934255ee..5fdc586cc038 100644
--- a/connectivity/source/drivers/jdbc/JConnection.cxx
+++ b/connectivity/source/drivers/jdbc/JConnection.cxx
@@ -259,7 +259,6 @@ jclass java_sql_Connection::theClass = nullptr;
 
 java_sql_Connection::java_sql_Connection( const java_sql_Driver& _rDriver )
     :java_lang_Object()
-    ,OSubComponent<java_sql_Connection, java_sql_Connection_BASE>(static_cast<cppu::OWeakObject*>(const_cast<java_sql_Driver *>(&_rDriver)), this)
     ,m_xContext( _rDriver.getContext() )
     ,m_pDriver( &_rDriver )
     ,m_pDriverobject(nullptr)
@@ -291,18 +290,12 @@ java_sql_Connection::~java_sql_Connection()
     }
 }
 
-void SAL_CALL java_sql_Connection::release() throw()
-{
-    release_ChildImpl();
-}
-
 void java_sql_Connection::disposing()
 {
     ::osl::MutexGuard aGuard(m_aMutex);
 
     m_aLogger.log( LogLevel::INFO, STR_LOG_SHUTDOWN_CONNECTION );
 
-    dispose_ChildImpl();
     java_sql_Connection_BASE::disposing();
 
     if ( object )
diff --git a/connectivity/source/drivers/jdbc/JStatement.cxx b/connectivity/source/drivers/jdbc/JStatement.cxx
index 16fbd290c197..fbbb0c9a36c9 100644
--- a/connectivity/source/drivers/jdbc/JStatement.cxx
+++ b/connectivity/source/drivers/jdbc/JStatement.cxx
@@ -89,7 +89,6 @@ void SAL_CALL OStatement_BASE2::disposing()
     ::comphelper::disposeComponent(m_xGeneratedStatement);
     m_pConnection.clear();
 
-    dispose_ChildImpl();
     java_sql_Statement_Base::disposing();
 }
 
@@ -109,12 +108,6 @@ void SAL_CALL java_sql_Statement_Base::disposing()
 }
 
 
-void SAL_CALL OStatement_BASE2::release() throw()
-{
-    release_ChildImpl();
-}
-
-
 Any SAL_CALL java_sql_Statement_Base::queryInterface( const Type & rType )
 {
     if ( m_pConnection.is() && !m_pConnection->isAutoRetrievingEnabled() && rType == cppu::UnoType<XGeneratedResultSet>::get())
diff --git a/connectivity/source/drivers/macab/MacabConnection.cxx b/connectivity/source/drivers/macab/MacabConnection.cxx
index fb3710df034d..eeea86def136 100644
--- a/connectivity/source/drivers/macab/MacabConnection.cxx
+++ b/connectivity/source/drivers/macab/MacabConnection.cxx
@@ -38,8 +38,7 @@ using namespace com::sun::star::sdbcx;
 IMPLEMENT_SERVICE_INFO(MacabConnection, "com.sun.star.sdbc.drivers.MacabConnection", "com.sun.star.sdbc.Connection")
 
 MacabConnection::MacabConnection(MacabDriver*   _pDriver)
-         : OSubComponent<MacabConnection, MacabConnection_BASE>(static_cast<cppu::OWeakObject*>(_pDriver), this),
-         m_pAddressBook(nullptr),
+         : m_pAddressBook(nullptr),
          m_pDriver(_pDriver)
 {
     m_pDriver->acquire();
@@ -54,11 +53,6 @@ MacabConnection::~MacabConnection()
     m_pDriver = nullptr;
 }
 
-void SAL_CALL MacabConnection::release() throw()
-{
-    release_ChildImpl();
-}
-
 void MacabConnection::construct(const OUString&, const Sequence< PropertyValue >&)
 {
     osl_atomic_increment( &m_refCount );
@@ -279,9 +273,8 @@ void MacabConnection::disposing()
         m_pAddressBook = nullptr;
     }
 
-    m_xMetaData = css::uno::WeakReference< css::sdbc::XDatabaseMetaData>();
+    m_xMetaData.clear();
 
-    dispose_ChildImpl();
     MacabConnection_BASE::disposing();
 }
 
diff --git a/connectivity/source/drivers/macab/MacabConnection.hxx b/connectivity/source/drivers/macab/MacabConnection.hxx
index 38b41a13c0b3..976e2fde3758 100644
--- a/connectivity/source/drivers/macab/MacabConnection.hxx
+++ b/connectivity/source/drivers/macab/MacabConnection.hxx
@@ -21,7 +21,6 @@
 #define INCLUDED_CONNECTIVITY_SOURCE_DRIVERS_MACAB_MACABCONNECTION_HXX
 
 #include <map>
-#include <connectivity/OSubComponent.hxx>
 #include <connectivity/CommonTools.hxx>
 #include <com/sun/star/lang/XServiceInfo.hpp>
 #include <com/sun/star/sdbc/SQLWarning.hpp>
@@ -45,16 +44,12 @@ namespace connectivity
         class MacabDriver;
         class MacabAddressBook;
 
-        //typedef OMetaConnection_BASE              MacabConnection_BASE; // implements basics and text encoding
         typedef std::vector< css::uno::WeakReferenceHelper > OWeakRefArray;
 
         typedef connectivity::OMetaConnection MacabConnection_BASE;
 
-        class MacabConnection : public MacabConnection_BASE,
-                                public OSubComponent<MacabConnection, MacabConnection_BASE>
+        class MacabConnection : public MacabConnection_BASE
         {
-            friend class OSubComponent<MacabConnection, MacabConnection_BASE>;
-
         protected:
 
             // Data attributes
@@ -74,9 +69,6 @@ namespace connectivity
             // OComponentHelper
             virtual void SAL_CALL disposing() override;
 
-            // XInterface
-            virtual void SAL_CALL release() throw() override;
-
             // XServiceInfo
             DECLARE_SERVICE_INFO();
 
diff --git a/connectivity/source/drivers/mork/MConnection.cxx b/connectivity/source/drivers/mork/MConnection.cxx
index 8ede63eb25fb..6dc6f2b19349 100644
--- a/connectivity/source/drivers/mork/MConnection.cxx
+++ b/connectivity/source/drivers/mork/MConnection.cxx
@@ -38,8 +38,7 @@ static const int defaultScope = 0x80;
 
 
 OConnection::OConnection(MorkDriver* _pDriver)
-    :OSubComponent<OConnection, OConnection_BASE>(static_cast<cppu::OWeakObject*>(_pDriver), this)
-    ,m_xDriver(_pDriver)
+    :m_xDriver(_pDriver)
     ,m_aColumnAlias( _pDriver->getFactory() )
 {
     m_pBook = new MorkParser();
@@ -54,12 +53,6 @@ OConnection::~OConnection()
     delete m_pHistory;
 }
 
-void SAL_CALL OConnection::release() throw()
-{
-    release_ChildImpl();
-}
-
-
 void OConnection::construct(const OUString& url)
 {
     SAL_INFO("connectivity.mork", "=> OConnection::construct()" );
@@ -349,7 +342,6 @@ void OConnection::disposing()
 {
     // we noticed that we should be destroyed in near future so we have to dispose our statements
     ::osl::MutexGuard aGuard(m_aMutex);
-    dispose_ChildImpl();
     m_xCatalog.clear();
 }
 
diff --git a/connectivity/source/drivers/mork/MConnection.hxx b/connectivity/source/drivers/mork/MConnection.hxx
index 3c2b2f179b10..6c7e8a7fac87 100644
--- a/connectivity/source/drivers/mork/MConnection.hxx
+++ b/connectivity/source/drivers/mork/MConnection.hxx
@@ -10,7 +10,6 @@
 #ifndef INCLUDED_CONNECTIVITY_SOURCE_DRIVERS_MORK_MCONNECTION_HXX
 #define INCLUDED_CONNECTIVITY_SOURCE_DRIVERS_MORK_MCONNECTION_HXX
 
-#include <connectivity/OSubComponent.hxx>
 #include <TConnection.hxx>
 #include "MColumnAlias.hxx"
 
@@ -28,11 +27,8 @@ namespace connectivity
 
         typedef connectivity::OMetaConnection OConnection_BASE; // implements basics and text encoding
 
-        class OConnection final : public OConnection_BASE,
-                            public connectivity::OSubComponent<OConnection, OConnection_BASE>
+        class OConnection final : public OConnection_BASE
         {
-            friend class connectivity::OSubComponent<OConnection, OConnection_BASE>;
-
             // Data attributes
 
             rtl::Reference<MorkDriver> m_xDriver;              //  Pointer to the owning
@@ -56,8 +52,6 @@ namespace connectivity
 
             // OComponentHelper
             virtual void SAL_CALL disposing() override;
-            // XInterface
-            virtual void SAL_CALL release() throw() override;
 
             // XServiceInfo
             DECLARE_SERVICE_INFO();
diff --git a/connectivity/source/drivers/mork/MStatement.cxx b/connectivity/source/drivers/mork/MStatement.cxx
index 34e94fa3f6e4..425eef8b898d 100644
--- a/connectivity/source/drivers/mork/MStatement.cxx
+++ b/connectivity/source/drivers/mork/MStatement.cxx
@@ -54,7 +54,6 @@ OStatement::OStatement( OConnection* _pConnection) : OCommonStatement( _pConnect
 OCommonStatement::OCommonStatement(OConnection* _pConnection )
     :OCommonStatement_IBASE(m_aMutex)
     ,OPropertySetHelper(OCommonStatement_IBASE::rBHelper)
-    ,OCommonStatement_SBASE(static_cast<cppu::OWeakObject*>(_pConnection), this)
     ,m_pTable(nullptr)
     ,m_pConnection(_pConnection)
     ,m_aParser( comphelper::getComponentContext(_pConnection->getDriver()->getFactory()) )
@@ -82,7 +81,6 @@ void OCommonStatement::disposing()
     m_pSQLIterator->dispose();
     delete m_pParseTree;
 
-    dispose_ChildImpl();
     OCommonStatement_IBASE::disposing();
 }
 
@@ -372,7 +370,7 @@ void SAL_CALL OCommonStatement::acquire() throw()
 
 void SAL_CALL OCommonStatement::release() throw()
 {
-    release_ChildImpl();
+    OCommonStatement_IBASE::release();
 }
 
 void SAL_CALL OStatement::acquire() throw()
diff --git a/connectivity/source/drivers/mork/MStatement.hxx b/connectivity/source/drivers/mork/MStatement.hxx
index dc4717915b45..71d980468ee5 100644
--- a/connectivity/source/drivers/mork/MStatement.hxx
+++ b/connectivity/source/drivers/mork/MStatement.hxx
@@ -43,16 +43,12 @@ namespace connectivity
         // is a base class for the normal statement and for the prepared statement
 
         class OCommonStatement;
-        typedef ::connectivity::OSubComponent< OCommonStatement, OCommonStatement_IBASE >  OCommonStatement_SBASE;
 
         class OCommonStatement  :public cppu::BaseMutex
                                 ,public OCommonStatement_IBASE
                                 ,public ::cppu::OPropertySetHelper
                                 ,public ::comphelper::OPropertyArrayUsageHelper< OCommonStatement >
-                                ,public OCommonStatement_SBASE
         {
-            friend class ::connectivity::OSubComponent< OCommonStatement, OCommonStatement_IBASE >;
-
         private:
             css::sdbc::SQLWarning                              m_aLastWarning;
 
diff --git a/connectivity/source/drivers/odbc/OConnection.cxx b/connectivity/source/drivers/odbc/OConnection.cxx
index 5ec273fc82b3..d2fbcb436693 100644
--- a/connectivity/source/drivers/odbc/OConnection.cxx
+++ b/connectivity/source/drivers/odbc/OConnection.cxx
@@ -45,8 +45,7 @@ using namespace com::sun::star::beans;
 using namespace com::sun::star::sdbc;
 
 OConnection::OConnection(const SQLHANDLE _pDriverHandle,ODBCDriver* _pDriver)
-                         : OSubComponent<OConnection, OConnection_BASE>(static_cast<cppu::OWeakObject*>(_pDriver), this)
-                         ,m_xDriver(_pDriver)
+                         :m_xDriver(_pDriver)
                          ,m_aConnectionHandle(nullptr)
                          ,m_pDriverHandleCopy(_pDriverHandle)
                          ,m_nStatementCount(0)
@@ -78,11 +77,6 @@ OConnection::~OConnection()
     }
 }
 
-void SAL_CALL OConnection::release() throw()
-{
-    release_ChildImpl();
-}
-
 oslGenericFunction OConnection::getOdbcFunction(ODBC3SQLFunctionId _nIndex)  const
 {
     OSL_ENSURE(m_xDriver.get(),"OConnection::getOdbcFunction: m_xDriver is null!");
@@ -480,8 +474,6 @@ void OConnection::disposing()
     if(!m_bClosed)
         N3SQLDisconnect(m_aConnectionHandle);
     m_bClosed   = true;
-
-    dispose_ChildImpl();
 }
 
 SQLHANDLE OConnection::createStatementHandle()
diff --git a/connectivity/source/drivers/odbc/OStatement.cxx b/connectivity/source/drivers/odbc/OStatement.cxx
index 4ea8f46358b3..5f40aca6a69a 100644
--- a/connectivity/source/drivers/odbc/OStatement.cxx
+++ b/connectivity/source/drivers/odbc/OStatement.cxx
@@ -112,17 +112,10 @@ void SAL_CALL OStatement_Base::disposing()
 
 void OStatement_BASE2::disposing()
 {
-    ::osl::MutexGuard aGuard(m_aMutex);
-
-    dispose_ChildImpl();
+    ::osl::MutexGuard aGuard1(m_aMutex);
     OStatement_Base::disposing();
 }
 
-void SAL_CALL OStatement_BASE2::release() throw()
-{
-    release_ChildImpl();
-}
-
 Any SAL_CALL OStatement_Base::queryInterface( const Type & rType )
 {
     if ( m_pConnection.is() && !m_pConnection->isAutoRetrievingEnabled() && rType == cppu::UnoType<XGeneratedResultSet>::get())
diff --git a/connectivity/source/inc/ado/AConnection.hxx b/connectivity/source/inc/ado/AConnection.hxx
index d546ab8ef154..a9c34814debe 100644
--- a/connectivity/source/inc/ado/AConnection.hxx
+++ b/connectivity/source/inc/ado/AConnection.hxx
@@ -22,7 +22,6 @@
 #include <com/sun/star/sdbc/SQLWarning.hpp>
 #include <com/sun/star/sdbcx/XTablesSupplier.hpp>
 #include <com/sun/star/beans/PropertyValue.hpp>
-#include <connectivity/OSubComponent.hxx>
 #include <map>
 #include <connectivity/CommonTools.hxx>
 #include <OTypeInfo.hxx>
@@ -48,11 +47,8 @@ namespace connectivity
         typedef connectivity::OMetaConnection                           OConnection_BASE;
 
 
-        class OConnection : public OConnection_BASE,
-                            public connectivity::OSubComponent<OConnection, OConnection_BASE>
+        class OConnection : public OConnection_BASE
         {
-            friend class connectivity::OSubComponent<OConnection, OConnection_BASE>;
-
         protected:
 
             // Data attributes
@@ -87,8 +83,6 @@ namespace connectivity
             DECLARE_SERVICE_INFO();
             // OComponentHelper
             virtual void SAL_CALL disposing() override;
-            // XInterface
-            virtual void SAL_CALL release() throw() override;
 
             // XConnection
             virtual css::uno::Reference< css::sdbc::XStatement > SAL_CALL createStatement(  ) override;
diff --git a/connectivity/source/inc/ado/AStatement.hxx b/connectivity/source/inc/ado/AStatement.hxx
index 3212f8220868..4f096b5fffc2 100644
--- a/connectivity/source/inc/ado/AStatement.hxx
+++ b/connectivity/source/inc/ado/AStatement.hxx
@@ -52,11 +52,9 @@ namespace connectivity
         class OStatement_Base       :   public cppu::BaseMutex,
                                         public  OStatement_BASE,
                                         public  ::cppu::OPropertySetHelper,
-                                        public  ::comphelper::OPropertyArrayUsageHelper<OStatement_Base>,
-                                        public  connectivity::OSubComponent<OStatement_Base, OStatement_BASE>
+                                        public  ::comphelper::OPropertyArrayUsageHelper<OStatement_Base>
 
         {
-            friend class connectivity::OSubComponent<OStatement_Base, OStatement_BASE>;
             friend class OResultSet;
 
             css::sdbc::SQLWarning          m_aLastWarning;
diff --git a/connectivity/source/inc/file/FConnection.hxx b/connectivity/source/inc/file/FConnection.hxx
index fe535c9d0fdf..ddb3dbc63264 100644
--- a/connectivity/source/inc/file/FConnection.hxx
+++ b/connectivity/source/inc/file/FConnection.hxx
@@ -22,7 +22,6 @@
 #include <com/sun/star/ucb/XContent.hpp>
 #include <com/sun/star/sdbc/SQLWarning.hpp>
 #include <com/sun/star/beans/PropertyValue.hpp>
-#include <connectivity/OSubComponent.hxx>
 #include <connectivity/CommonTools.hxx>
 #include <OTypeInfo.hxx>
 #include <rtl/ustring.hxx>
@@ -42,12 +41,8 @@ namespace connectivity
         class ODatabaseMetaData;
         class OFileDriver;
 
-        class OOO_DLLPUBLIC_FILE OConnection :
-                            public connectivity::OMetaConnection,
-                            public connectivity::OSubComponent<OConnection, connectivity::OMetaConnection>
+        class OOO_DLLPUBLIC_FILE OConnection : public connectivity::OMetaConnection
         {
-            friend class connectivity::OSubComponent<OConnection, connectivity::OMetaConnection>;
-
         protected:
 
             // Data attributes
@@ -82,8 +77,6 @@ namespace connectivity
 
             // OComponentHelper
             virtual void SAL_CALL disposing() override;
-            // XInterface
-            virtual void SAL_CALL release() throw() override;
 
             // XServiceInfo
             DECLARE_SERVICE_INFO();
diff --git a/connectivity/source/inc/file/FStatement.hxx b/connectivity/source/inc/file/FStatement.hxx
index 936703b4d281..fd5006c83253 100644
--- a/connectivity/source/inc/file/FStatement.hxx
+++ b/connectivity/source/inc/file/FStatement.hxx
@@ -162,15 +162,11 @@ namespace connectivity
             virtual void SAL_CALL close(  ) override;
         };
 
-        class OOO_DLLPUBLIC_FILE OStatement_BASE2 :
-                                    public OStatement_Base,
-                                    public connectivity::OSubComponent<OStatement_BASE2, OStatement_BASE>
+        class OOO_DLLPUBLIC_FILE OStatement_BASE2 : public OStatement_Base
 
         {
-            friend class connectivity::OSubComponent<OStatement_BASE2, OStatement_BASE>;
         public:
-            OStatement_BASE2(OConnection* _pConnection ) :  OStatement_Base(_pConnection ),
-                                    connectivity::OSubComponent<OStatement_BASE2, OStatement_BASE>(static_cast<cppu::OWeakObject*>(_pConnection), this){}
+            OStatement_BASE2(OConnection* _pConnection ) : OStatement_Base(_pConnection ) {}
             // OComponentHelper
             virtual void SAL_CALL disposing() override;
             // XInterface
diff --git a/connectivity/source/inc/java/sql/Connection.hxx b/connectivity/source/inc/java/sql/Connection.hxx
index bab9329dfb1c..528f0eddf537 100644
--- a/connectivity/source/inc/java/sql/Connection.hxx
+++ b/connectivity/source/inc/java/sql/Connection.hxx
@@ -22,7 +22,6 @@
 #include <java/lang/Object.hxx>
 #include <TConnection.hxx>
 #include <connectivity/CommonTools.hxx>
-#include <connectivity/OSubComponent.hxx>
 #include <cppuhelper/weakref.hxx>
 #include <AutoRetrievingBase.hxx>
 #include <java/sql/ConnectionLog.hxx>
@@ -39,10 +38,8 @@ namespace connectivity
 
     class java_sql_Connection : public java_sql_Connection_BASE,
                                 public java_lang_Object,
-                                public OSubComponent<java_sql_Connection, java_sql_Connection_BASE>,
                                 public OAutoRetrievingBase
     {
-        friend class OSubComponent<java_sql_Connection, java_sql_Connection_BASE>;
         css::uno::Reference< css::uno::XComponentContext > m_xContext;
         const java_sql_Driver*  m_pDriver;
         jobject                 m_pDriverobject;
@@ -110,8 +107,6 @@ namespace connectivity
 
         // OComponentHelper
         virtual void SAL_CALL disposing() override;
-        // XInterface
-        virtual void SAL_CALL release() throw() override;
 
         // XConnection
         virtual css::uno::Reference< css::sdbc::XStatement > SAL_CALL createStatement(  ) override;
diff --git a/connectivity/source/inc/java/sql/JStatement.hxx b/connectivity/source/inc/java/sql/JStatement.hxx
index 52b6c5fe5995..a6cde3aa2ac3 100644
--- a/connectivity/source/inc/java/sql/JStatement.hxx
+++ b/connectivity/source/inc/java/sql/JStatement.hxx
@@ -32,7 +32,6 @@
 #include <cppuhelper/basemutex.hxx>
 #include <comphelper/uno3.hxx>
 #include <connectivity/CommonTools.hxx>
-#include <connectivity/OSubComponent.hxx>
 #include <com/sun/star/lang/XServiceInfo.hpp>
 
 #include <java/sql/Connection.hxx>
@@ -196,19 +195,14 @@ namespace connectivity
         using ::cppu::OPropertySetHelper::getFastPropertyValue;
     };
 
-    class OStatement_BASE2  :public java_sql_Statement_Base
-                            ,public OSubComponent<OStatement_BASE2, java_sql_Statement_BASE>
+    class OStatement_BASE2 : public java_sql_Statement_Base
 
     {
-        friend class OSubComponent<OStatement_BASE2, java_sql_Statement_BASE>;
     public:
-        OStatement_BASE2(JNIEnv * pEnv, java_sql_Connection& _rCon ) : java_sql_Statement_Base( pEnv, _rCon ),
-                                OSubComponent<OStatement_BASE2, java_sql_Statement_BASE>(static_cast<cppu::OWeakObject*>(&_rCon), this){}
+        OStatement_BASE2(JNIEnv * pEnv, java_sql_Connection& _rCon ) : java_sql_Statement_Base( pEnv, _rCon ) {}
 
         // OComponentHelper
         virtual void SAL_CALL disposing() override;
-        // XInterface
-        virtual void SAL_CALL release() throw() override;
     };
 
     class java_sql_Statement :  public OStatement_BASE2,
diff --git a/connectivity/source/inc/odbc/OConnection.hxx b/connectivity/source/inc/odbc/OConnection.hxx
index f9cd473b3b77..3cfda3792a8e 100644
--- a/connectivity/source/inc/odbc/OConnection.hxx
+++ b/connectivity/source/inc/odbc/OConnection.hxx
@@ -23,7 +23,6 @@
 #include <com/sun/star/beans/PropertyValue.hpp>
 #include <connectivity/odbc.hxx>
 #include <odbc/odbcbasedllapi.hxx>
-#include <connectivity/OSubComponent.hxx>
 #include <connectivity/CommonTools.hxx>
 #include <TConnection.hxx>
 #include <OTypeInfo.hxx>
@@ -46,11 +45,8 @@ namespace connectivity
 
         class OOO_DLLPUBLIC_ODBCBASE OConnection :
                             public OConnection_BASE,
-                            public connectivity::OSubComponent<OConnection, OConnection_BASE>,
                             public OAutoRetrievingBase
         {
-            friend class connectivity::OSubComponent<OConnection, OConnection_BASE>;
-
         protected:
 
             // Data attributes
@@ -87,8 +83,6 @@ namespace connectivity
 
             // OComponentHelper
             virtual void SAL_CALL disposing() override;
-            // XInterface
-            virtual void SAL_CALL release() throw() override;
 
             // XServiceInfo
             DECLARE_SERVICE_INFO();
diff --git a/connectivity/source/inc/odbc/OStatement.hxx b/connectivity/source/inc/odbc/OStatement.hxx
index e93f6c7ba5dd..29d4f51612ba 100644
--- a/connectivity/source/inc/odbc/OStatement.hxx
+++ b/connectivity/source/inc/odbc/OStatement.hxx
@@ -211,19 +211,14 @@ namespace connectivity
             using OPropertySetHelper::getFastPropertyValue;
         };
 
-        class OOO_DLLPUBLIC_ODBCBASE OStatement_BASE2 :
-                                 public OStatement_Base
-                                ,public ::connectivity::OSubComponent<OStatement_BASE2, OStatement_BASE>
-
+        class OOO_DLLPUBLIC_ODBCBASE OStatement_BASE2 : public OStatement_Base
         {
-            friend class OSubComponent<OStatement_BASE2, OStatement_BASE>;
         public:
-            OStatement_BASE2(OConnection* _pConnection ) :  OStatement_Base(_pConnection ),
-                                    ::connectivity::OSubComponent<OStatement_BASE2, OStatement_BASE>(static_cast<cppu::OWeakObject*>(_pConnection), this){}
+            OStatement_BASE2(OConnection* _pConnection ) :
+                OStatement_Base(_pConnection )
+            {}
             // OComponentHelper
             virtual void SAL_CALL disposing() override;
-            // XInterface
-            virtual void SAL_CALL release() throw() override;
         };
 
         class OOO_DLLPUBLIC_ODBCBASE OStatement :
diff --git a/connectivity/source/sdbcx/VCatalog.cxx b/connectivity/source/sdbcx/VCatalog.cxx
index 50d65c2a56c6..96f32461871e 100644
--- a/connectivity/source/sdbcx/VCatalog.cxx
+++ b/connectivity/source/sdbcx/VCatalog.cxx
@@ -37,7 +37,6 @@ using namespace ::com::sun::star::lang;
 IMPLEMENT_SERVICE_INFO(OCatalog,"com.sun.star.comp.connectivity.OCatalog","com.sun.star.sdbcx.DatabaseDefinition")
 
 OCatalog::OCatalog(const Reference< XConnection> &_xConnection) : OCatalog_BASE(m_aMutex)
-            ,connectivity::OSubComponent<OCatalog, OCatalog_BASE>(_xConnection, this)
             ,m_pTables(nullptr)
             ,m_pViews(nullptr)
             ,m_pGroups(nullptr)
@@ -57,12 +56,6 @@ OCatalog::~OCatalog()
 {
 }
 
-void SAL_CALL OCatalog::release() throw()
-{
-    release_ChildImpl();
-}
-
-
 void SAL_CALL OCatalog::disposing()
 {
     ::osl::MutexGuard aGuard(m_aMutex);
@@ -76,7 +69,6 @@ void SAL_CALL OCatalog::disposing()
     if(m_pUsers)
         m_pUsers->disposing();
 
-    dispose_ChildImpl();
     OCatalog_BASE::disposing();
 }
 
diff --git a/include/connectivity/OSubComponent.hxx b/include/connectivity/OSubComponent.hxx
deleted file mode 100644
index 0ee4e1248099..000000000000
--- a/include/connectivity/OSubComponent.hxx
+++ /dev/null
@@ -1,89 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*
- * This file is part of the LibreOffice project.
- *
- * This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/.
- *
- * This file incorporates work covered by the following license notice:
- *
- *   Licensed to the Apache Software Foundation (ASF) under one or more
- *   contributor license agreements. See the NOTICE file distributed
- *   with this work for additional information regarding copyright
- *   ownership. The ASF licenses this file to you under the Apache
- *   License, Version 2.0 (the "License"); you may not use this file
- *   except in compliance with the License. You may obtain a copy of
- *   the License at http://www.apache.org/licenses/LICENSE-2.0 .
- */
-
-#ifndef INCLUDED_CONNECTIVITY_OSUBCOMPONENT_HXX
-#define INCLUDED_CONNECTIVITY_OSUBCOMPONENT_HXX
-
-#include <cppuhelper/weak.hxx>
-#include <cppuhelper/interfacecontainer.h>
-#include <connectivity/dbtoolsdllapi.hxx>
-
-namespace com
-{
-    namespace sun
-    {
-        namespace star
-        {
-            namespace lang
-            {
-                class XComponent;
-            }
-        }
-    }
-}
-namespace connectivity
-{
-    OOO_DLLPUBLIC_DBTOOLS
-    void release(oslInterlockedCount& _refCount,
-                 ::cppu::OBroadcastHelper& rBHelper,
-                 css::uno::Reference< css::uno::XInterface >& _xInterface,
-                 css::lang::XComponent* _pObject) throw ();
-
-    // OSubComponent
-
-    template <class SELF, class WEAK> class OSubComponent
-    {
-    protected:
-        // the parent must support the tunnel implementation
-        css::uno::Reference< css::uno::XInterface > m_xParent;
-        SELF*   m_pDerivedImplementation;
-
-    public:
-        OSubComponent(
-                const css::uno::Reference< css::uno::XInterface >& _xParent,
-                SELF* _pDerivedImplementation)
-            :m_xParent(_xParent)
-            ,m_pDerivedImplementation(_pDerivedImplementation)
-        {
-        }
-
-    protected:
-        void dispose_ChildImpl()
-        {
-            // avoid ambiguity
-            ::osl::MutexGuard aGuard( m_pDerivedImplementation->WEAK::rBHelper.rMutex );
-        m_xParent.clear();
-        }
-        void release_ChildImpl() throw ()
-        {
-#if 0
-            ::connectivity::release(m_pDerivedImplementation->m_refCount,
-                                    m_pDerivedImplementation->WEAK::rBHelper,
-                                    m_xParent,
-                                    m_pDerivedImplementation);
-
-#endif
-            m_pDerivedImplementation->WEAK::release();
-        }
-    };
-}
-
-#endif // INCLUDED_CONNECTIVITY_OSUBCOMPONENT_HXX
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/connectivity/sdbcx/VCatalog.hxx b/include/connectivity/sdbcx/VCatalog.hxx
index a5e1dfbb2b1b..e39cd11abb22 100644
--- a/include/connectivity/sdbcx/VCatalog.hxx
+++ b/include/connectivity/sdbcx/VCatalog.hxx
@@ -30,7 +30,6 @@
 #include <cppuhelper/compbase.hxx>
 #include <com/sun/star/lang/XServiceInfo.hpp>
 #include <connectivity/CommonTools.hxx>
-#include <connectivity/OSubComponent.hxx>
 #include <connectivity/sdbcx/IRefreshable.hxx>
 #include <connectivity/dbtoolsdllapi.hxx>
 #include <memory>
@@ -55,10 +54,8 @@ namespace connectivity
         class OOO_DLLPUBLIC_DBTOOLS SAL_NO_VTABLE OCatalog :
                             public OCatalog_BASE,
                             public IRefreshableGroups,
-                            public IRefreshableUsers,
-                            public connectivity::OSubComponent<OCatalog, OCatalog_BASE>
+                            public IRefreshableUsers
         {
-            friend class connectivity::OSubComponent<OCatalog, OCatalog_BASE>;
         protected:
 
             ::osl::Mutex        m_aMutex;
@@ -104,8 +101,6 @@ namespace connectivity
 
             // ::cppu::OComponentHelper
             virtual void SAL_CALL disposing() override;
-            // XInterface
-            void SAL_CALL release() throw() override;
             // XTablesSupplier
             virtual css::uno::Reference< css::container::XNameAccess > SAL_CALL getTables(  ) override;
             // XViewsSupplier
diff --git a/mysqlc/source/mysqlc_connection.cxx b/mysqlc/source/mysqlc_connection.cxx
index 65984285b81b..e53a3b560cb0 100644
--- a/mysqlc/source/mysqlc_connection.cxx
+++ b/mysqlc/source/mysqlc_connection.cxx
@@ -63,7 +63,6 @@ using ::osl::MutexGuard;
 
 OConnection::OConnection(MysqlCDriver& _rDriver, sql::Driver * _cppDriver)
     :OMetaConnection_BASE(m_aMutex)
-    ,OSubComponent<OConnection, OConnection_BASE>(static_cast<cppu::OWeakObject*>(&_rDriver), this)
     ,m_xMetaData(nullptr)
     ,m_xDriver(&_rDriver)
     ,cppDriver(_cppDriver)
@@ -77,12 +76,6 @@ OConnection::~OConnection()
     }
 }
 
-void SAL_CALL OConnection::release()
-    throw()
-{
-    release_ChildImpl();
-}
-
 void OConnection::construct(const rtl::OUString& url, const Sequence< PropertyValue >& info)
 {
     MutexGuard aGuard(m_aMutex);
@@ -505,7 +498,6 @@ void OConnection::disposing()
 
     m_xMetaData = WeakReference< XDatabaseMetaData >();
 
-    dispose_ChildImpl();
     OConnection_BASE::disposing();
 }
 
diff --git a/mysqlc/source/mysqlc_connection.hxx b/mysqlc/source/mysqlc_connection.hxx
index 63c121c99a2e..a305d6a9ab89 100644
--- a/mysqlc/source/mysqlc_connection.hxx
+++ b/mysqlc/source/mysqlc_connection.hxx
@@ -83,11 +83,8 @@ namespace connectivity
         typedef std::vector< css::uno::WeakReferenceHelper > OWeakRefArray;
 
         class OConnection final : public OBase_Mutex,
-                            public OConnection_BASE,
-                            public connectivity::mysqlc::OSubComponent<OConnection, OConnection_BASE>
+                            public OConnection_BASE
         {
-            friend class connectivity::mysqlc::OSubComponent<OConnection, OConnection_BASE>;
-
             ConnectionSettings  m_settings;
             css::uno::Reference< css::container::XNameAccess > m_typeMap;
             css::uno::Reference< css::util::XStringSubstitution > m_xParameterSubstitution;
@@ -120,9 +117,6 @@ namespace connectivity
             // OComponentHelper
             virtual void SAL_CALL disposing() SAL_OVERRIDE;
 
-            // XInterface
-            virtual void SAL_CALL release()                     throw() SAL_OVERRIDE;
-
             // XServiceInfo
             virtual rtl::OUString SAL_CALL getImplementationName() SAL_OVERRIDE;
 
diff --git a/mysqlc/source/mysqlc_statement.cxx b/mysqlc/source/mysqlc_statement.cxx
index 0448ac5dcabc..1d86127bd879 100644
--- a/mysqlc/source/mysqlc_statement.cxx
+++ b/mysqlc/source/mysqlc_statement.cxx
@@ -55,7 +55,6 @@ using ::osl::MutexGuard;
 OCommonStatement::OCommonStatement(OConnection* _pConnection, sql::Statement *_cppStatement)
     :OCommonStatement_IBase(m_aMutex)
     ,OPropertySetHelper(OCommonStatement_IBase::rBHelper)
-    ,OStatement_CBase( static_cast<cppu::OWeakObject*>(_pConnection), this )
     ,m_xConnection(_pConnection)
     ,cppStatement(_cppStatement)
 {
@@ -81,7 +80,6 @@ void OCommonStatement::disposing()
     m_xConnection.clear();
     delete cppStatement;
 
-    dispose_ChildImpl();
     OCommonStatement_IBase::disposing();
 }
 
@@ -353,7 +351,7 @@ void SAL_CALL OCommonStatement::acquire()
 void SAL_CALL OCommonStatement::release()
     throw()
 {
-    release_ChildImpl();
+    OCommonStatement_IBase::release();
 }
 
 void SAL_CALL OStatement::acquire()
diff --git a/mysqlc/source/mysqlc_statement.hxx b/mysqlc/source/mysqlc_statement.hxx
index 5e9c0be3b611..1bb4d2a8d7be 100644
--- a/mysqlc/source/mysqlc_statement.hxx
+++ b/mysqlc/source/mysqlc_statement.hxx
@@ -51,10 +51,6 @@ namespace connectivity
                                                     css::sdbc::XCloseable,
                                                     css::sdbc::XMultipleResults> OCommonStatement_IBase;
 
-        class OCommonStatement;
-        typedef OSubComponent< OCommonStatement, OCommonStatement_IBase >   OStatement_CBase;
-
-
         //************ Class: OCommonStatement
         // is a base class for the normal statement and for the prepared statement
 
@@ -62,11 +58,8 @@ namespace connectivity
                                 ,public OCommonStatement_IBase
                                 ,public ::cppu::OPropertySetHelper
                                 ,public OPropertyArrayUsageHelper<OCommonStatement>
-                                ,public OStatement_CBase
 
         {
-            friend class OSubComponent< OCommonStatement, OCommonStatement_IBase >;
-
         private:
             SQLWarning m_aLastWarning;
 
diff --git a/mysqlc/source/mysqlc_subcomponent.hxx b/mysqlc/source/mysqlc_subcomponent.hxx
index c0dc8eb3acb2..664f4bdd74c8 100644
--- a/mysqlc/source/mysqlc_subcomponent.hxx
+++ b/mysqlc/source/mysqlc_subcomponent.hxx
@@ -58,39 +58,6 @@ namespace connectivity
         /// @throws css::lang::DisposedException
         void checkDisposed(bool _bThrow);
 
-        template <class SELF, class WEAK> class OSubComponent
-        {
-        protected:
-            // the parent must support the tunnel implementation
-            css::uno::Reference< css::uno::XInterface > m_xParent;
-            SELF*   m_pDerivedImplementation;
-
-        public:
-            OSubComponent(
-                    const css::uno::Reference< css::uno::XInterface >& _xParent,
-                    SELF* _pDerivedImplementation)
-                :m_xParent(_xParent)
-                ,m_pDerivedImplementation(_pDerivedImplementation)
-            {
-            }
-
-        protected:
-            void dispose_ChildImpl()
-            {
-                ::osl::MutexGuard aGuard(m_pDerivedImplementation->rBHelper.rMutex);
-                m_xParent = nullptr;
-            }
-            void release_ChildImpl()
-            {
-                release(m_pDerivedImplementation->m_refCount,
-                                        m_pDerivedImplementation->rBHelper,
-                                        m_xParent,
-                                        m_pDerivedImplementation);
-
-                m_pDerivedImplementation->WEAK::release();
-            }
-        };
-
         template <class TYPE>
         class OPropertyArrayUsageHelper
         {


More information about the Libreoffice-commits mailing list