diff options
author | David Tardon <dtardon@redhat.com> | 2014-11-03 17:52:23 +0100 |
---|---|---|
committer | David Tardon <dtardon@redhat.com> | 2014-11-03 18:51:00 +0100 |
commit | bce4f8dd83143c74c52d2fbb4527ba8a1ff71ed3 (patch) | |
tree | 00026a05e7bc9919323fe41670253d93aeb23b83 /svx | |
parent | 6631ed540b701d4f8e04b34f528c6531980b1823 (diff) |
coverity#982188 unchecked return value
Change-Id: I8b99afa5d43e1a9f003c3b31175d73bf5a289232
Diffstat (limited to 'svx')
-rw-r--r-- | svx/source/accessibility/AccessibleTextHelper.cxx | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/svx/source/accessibility/AccessibleTextHelper.cxx b/svx/source/accessibility/AccessibleTextHelper.cxx index 751cb0df06cd..6338f2d403c8 100644 --- a/svx/source/accessibility/AccessibleTextHelper.cxx +++ b/svx/source/accessibility/AccessibleTextHelper.cxx @@ -1633,7 +1633,19 @@ namespace accessibility { if( getNotifierClientId() != -1 ) - ::comphelper::AccessibleEventNotifier::removeEventListener( getNotifierClientId(), xListener ); + { + const sal_Int32 nListenerCount = ::comphelper::AccessibleEventNotifier::removeEventListener( getNotifierClientId(), xListener ); + if ( !nListenerCount ) + { + // no listeners anymore + // -> revoke ourself. This may lead to the notifier thread dying (if we were the last client), + // and at least to us not firing any events anymore, in case somebody calls + // NotifyAccessibleEvent, again + ::comphelper::AccessibleEventNotifier::TClientId nId( getNotifierClientId() ); + mnNotifierClientId = -1; + ::comphelper::AccessibleEventNotifier::revokeClient( nId ); + } + } } uno::Reference< XAccessible > SAL_CALL AccessibleTextHelper_Impl::getAccessibleAtPoint( const awt::Point& _aPoint ) |