summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorArmin Le Grand (allotropia) <armin.le.grand.extern@allotropia.de>2023-11-10 17:59:11 +0100
committerArmin Le Grand <Armin.Le.Grand@me.com>2023-11-10 20:05:11 +0100
commit23e9a4cf1eec75cdd40a695ecae2af9b952178d3 (patch)
treeadffe2f0aed521d2acde5f9e4bcf52088c83a1ba
parent867c4b75dd4a2cf9470c2859d51432f207eb4166 (diff)
tdf#158169 take no actions in disposed incarnation
Using the described steps in the bug report it is possible to have an already disposed incarnation of ChildrenManagerImpl that gets called with notifyEvent. If exposed it is necessary not to execute actions, but to inform the caller by triggering a lang::DisposedException(). The SfxBaseModel::notifyEvent that executes this will then remove the instance from it's list. Change-Id: Ie39e37d6e55ea66f441e732b612774b18d7c3ca1 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/159306 Tested-by: Jenkins Reviewed-by: Armin Le Grand <Armin.Le.Grand@me.com>
-rw-r--r--svx/source/accessibility/ChildrenManagerImpl.cxx5
1 files changed, 5 insertions, 0 deletions
diff --git a/svx/source/accessibility/ChildrenManagerImpl.cxx b/svx/source/accessibility/ChildrenManagerImpl.cxx
index 96e27c079e9b..5271f1887b83 100644
--- a/svx/source/accessibility/ChildrenManagerImpl.cxx
+++ b/svx/source/accessibility/ChildrenManagerImpl.cxx
@@ -681,6 +681,11 @@ void SAL_CALL
ChildrenManagerImpl::notifyEvent (
const document::EventObject& rEventObject)
{
+ // tdf#158169 if we are already disposed, execute no actions, but inform the
+ // caller that we are disposed
+ if ( m_bDisposed )
+ throw lang::DisposedException();
+
if (rEventObject.EventName == "ShapeInserted")
AddShape (Reference<drawing::XShape>(rEventObject.Source, uno::UNO_QUERY));
else if (rEventObject.EventName == "ShapeRemoved")