diff options
author | Noel Grandin <noel@peralex.com> | 2016-05-24 11:02:42 +0200 |
---|---|---|
committer | Noel Grandin <noel@peralex.com> | 2016-05-24 11:02:42 +0200 |
commit | 95d20a3799998b9816bd2e8aebdbc96c61cead3e (patch) | |
tree | 8206ecc848631432cb8b027d5e780483734f808a /comphelper | |
parent | 3caf31b05d7bbf3d50a1bbda6c8b95982cb5c2b5 (diff) |
Revert "remove some manual ref-counting"
until I have a better understanding of the UNO reference
counting.
This reverts commit 111de438ea3e512a541281dc0716cc728ea8d152.
Diffstat (limited to 'comphelper')
-rw-r--r-- | comphelper/source/misc/accessiblewrapper.cxx | 22 |
1 files changed, 14 insertions, 8 deletions
diff --git a/comphelper/source/misc/accessiblewrapper.cxx b/comphelper/source/misc/accessiblewrapper.cxx index 41fb4f540fed..e106b9dd14e1 100644 --- a/comphelper/source/misc/accessiblewrapper.cxx +++ b/comphelper/source/misc/accessiblewrapper.cxx @@ -347,15 +347,18 @@ namespace comphelper ,m_xInnerContext( _rxInnerAccessibleContext ) ,m_xOwningAccessible( _rxOwningAccessible ) ,m_xParentAccessible( _rxParentAccessible ) - // initialize the mapper for our children - ,m_xChildMapper( new OWrappedAccessibleChildrenManager( getComponentContext() ) ) + ,m_pChildMapper( nullptr ) { + // initialize the mapper for our children + m_pChildMapper = new OWrappedAccessibleChildrenManager( getComponentContext() ); + m_pChildMapper->acquire(); + // 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_xChildMapper->setTransientChildren( !xStates.is() || xStates->contains( AccessibleStateType::MANAGES_DESCENDANTS) ); + m_pChildMapper->setTransientChildren( !xStates.is() || xStates->contains( AccessibleStateType::MANAGES_DESCENDANTS) ); - m_xChildMapper->setOwningAccessible( m_xOwningAccessible ); + m_pChildMapper->setOwningAccessible( m_xOwningAccessible ); } @@ -380,6 +383,9 @@ 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; } @@ -405,7 +411,7 @@ namespace comphelper { // get the child of the wrapped component Reference< XAccessible > xInnerChild = m_xInnerContext->getAccessibleChild( i ); - return m_xChildMapper->getAccessibleWrapperFor( xInnerChild ); + return m_pChildMapper->getAccessibleWrapperFor( xInnerChild ); } @@ -440,10 +446,10 @@ namespace comphelper // translate the event queryInterface( cppu::UnoType<XInterface>::get() ) >>= aTranslatedEvent.Source; - m_xChildMapper->translateAccessibleEvent( _rEvent, aTranslatedEvent ); + m_pChildMapper->translateAccessibleEvent( _rEvent, aTranslatedEvent ); // see if any of these notifications affect our child manager - m_xChildMapper->handleChildNotification( _rEvent ); + m_pChildMapper->handleChildNotification( _rEvent ); if ( aTranslatedEvent.NewValue == m_xInner ) aTranslatedEvent.NewValue = makeAny(aTranslatedEvent.Source); @@ -466,7 +472,7 @@ namespace comphelper xBroadcaster->removeAccessibleEventListener( this ); // dispose the child cache/map - m_xChildMapper->dispose(); + m_pChildMapper->dispose(); // let the base class dispose the inner component OComponentProxyAggregationHelper::dispose(); |