summaryrefslogtreecommitdiff
path: root/winaccessibility/source
diff options
context:
space:
mode:
authorMichael Stahl <mstahl@redhat.com>2013-12-12 00:09:41 +0100
committerMichael Stahl <mstahl@redhat.com>2013-12-12 20:06:26 +0100
commit9e351edccf3b9a71bb310bcaefe07821479ff5e5 (patch)
treee2dc5ecc3a7e04af32394a702baef0fd6f3721e1 /winaccessibility/source
parentb6664d0649d9be6208b39d6dd276e40347af44c3 (diff)
winaccessibility: fix exception handling in AccEventListener
RemoveMeFromBroadcaster() may catch a DisposedException and then not call NotifyDestroy. Change-Id: I2b766541c3e6800c88a83aa482de0093714d39c2
Diffstat (limited to 'winaccessibility/source')
-rw-r--r--winaccessibility/source/service/AccEventListener.cxx18
1 files changed, 12 insertions, 6 deletions
diff --git a/winaccessibility/source/service/AccEventListener.cxx b/winaccessibility/source/service/AccEventListener.cxx
index 73b043111f69..7874f4706321 100644
--- a/winaccessibility/source/service/AccEventListener.cxx
+++ b/winaccessibility/source/service/AccEventListener.cxx
@@ -233,14 +233,20 @@ void AccEventListener::RemoveMeFromBroadcaster()
{
return;
}
- Reference<XAccessibleEventBroadcaster> const xBroadcaster(
- m_xAccessible->getAccessibleContext(), UNO_QUERY);
- if (xBroadcaster.is())
+ try
{
- //remove the lister from accessible object
- xBroadcaster->removeAccessibleEventListener(this);
- pAgent->NotifyDestroy(m_xAccessible.get());
+ Reference<XAccessibleEventBroadcaster> const xBroadcaster(
+ m_xAccessible->getAccessibleContext(), UNO_QUERY);
+ if (xBroadcaster.is())
+ {
+ //remove the lister from accessible object
+ xBroadcaster->removeAccessibleEventListener(this);
+ }
}
+ catch (Exception const&)
+ { // may throw if it's already disposed - ignore that
+ }
+ pAgent->NotifyDestroy(m_xAccessible.get());
m_xAccessible.clear(); // release cyclic reference
}
catch(...)