diff options
author | Noel Grandin <noel@peralex.com> | 2016-05-23 13:53:42 +0200 |
---|---|---|
committer | Noel Grandin <noelgrandin@gmail.com> | 2016-05-24 06:54:06 +0000 |
commit | 111de438ea3e512a541281dc0716cc728ea8d152 (patch) | |
tree | 2c9ca866e79ed0cfc9299e553a87239345c515a6 /comphelper | |
parent | Convert T_DRIVERTYPE to scoped enum (diff) | |
download | core-111de438ea3e512a541281dc0716cc728ea8d152.tar.gz core-111de438ea3e512a541281dc0716cc728ea8d152.zip |
remove some manual ref-counting
triggered when I noticed a class doing acquire() in the constructor and
then release() in the destructor.
found mostly by
git grep -n -B5 -e '->release()'
Change-Id: Ie1abeaed75c1f861df185e3bde680272dbadc97f
Reviewed-on: https://gerrit.libreoffice.org/25363
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noelgrandin@gmail.com>
Diffstat (limited to 'comphelper')
-rw-r--r-- | comphelper/source/misc/accessiblewrapper.cxx | 22 |
1 files changed, 8 insertions, 14 deletions
diff --git a/comphelper/source/misc/accessiblewrapper.cxx b/comphelper/source/misc/accessiblewrapper.cxx index e106b9dd14e1..41fb4f540fed 100644 --- a/comphelper/source/misc/accessiblewrapper.cxx +++ b/comphelper/source/misc/accessiblewrapper.cxx @@ -347,18 +347,15 @@ namespace comphelper ,m_xInnerContext( _rxInnerAccessibleContext ) ,m_xOwningAccessible( _rxOwningAccessible ) ,m_xParentAccessible( _rxParentAccessible ) - ,m_pChildMapper( nullptr ) - { // initialize the mapper for our children - m_pChildMapper = new OWrappedAccessibleChildrenManager( getComponentContext() ); - m_pChildMapper->acquire(); - + ,m_xChildMapper( new OWrappedAccessibleChildrenManager( getComponentContext() ) ) + { // determine if we're allowed to cache children Reference< XAccessibleStateSet > xStates( m_xInnerContext->getAccessibleStateSet( ) ); OSL_ENSURE( xStates.is(), "OAccessibleContextWrapperHelper::OAccessibleContextWrapperHelper: no inner state set!" ); - m_pChildMapper->setTransientChildren( !xStates.is() || xStates->contains( AccessibleStateType::MANAGES_DESCENDANTS) ); + m_xChildMapper->setTransientChildren( !xStates.is() || xStates->contains( AccessibleStateType::MANAGES_DESCENDANTS) ); - m_pChildMapper->setOwningAccessible( m_xOwningAccessible ); + m_xChildMapper->setOwningAccessible( m_xOwningAccessible ); } @@ -383,9 +380,6 @@ namespace comphelper OAccessibleContextWrapperHelper::~OAccessibleContextWrapperHelper( ) { OSL_ENSURE( m_rBHelper.bDisposed, "OAccessibleContextWrapperHelper::~OAccessibleContextWrapperHelper: you should ensure (in your dtor) that the object is disposed!" ); - - m_pChildMapper->release(); - m_pChildMapper = nullptr; } @@ -411,7 +405,7 @@ namespace comphelper { // get the child of the wrapped component Reference< XAccessible > xInnerChild = m_xInnerContext->getAccessibleChild( i ); - return m_pChildMapper->getAccessibleWrapperFor( xInnerChild ); + return m_xChildMapper->getAccessibleWrapperFor( xInnerChild ); } @@ -446,10 +440,10 @@ namespace comphelper // translate the event queryInterface( cppu::UnoType<XInterface>::get() ) >>= aTranslatedEvent.Source; - m_pChildMapper->translateAccessibleEvent( _rEvent, aTranslatedEvent ); + m_xChildMapper->translateAccessibleEvent( _rEvent, aTranslatedEvent ); // see if any of these notifications affect our child manager - m_pChildMapper->handleChildNotification( _rEvent ); + m_xChildMapper->handleChildNotification( _rEvent ); if ( aTranslatedEvent.NewValue == m_xInner ) aTranslatedEvent.NewValue = makeAny(aTranslatedEvent.Source); @@ -472,7 +466,7 @@ namespace comphelper xBroadcaster->removeAccessibleEventListener( this ); // dispose the child cache/map - m_pChildMapper->dispose(); + m_xChildMapper->dispose(); // let the base class dispose the inner component OComponentProxyAggregationHelper::dispose(); |