svx/source/accessibility/ChildrenManagerImpl.cxx | 5 +++++ 1 file changed, 5 insertions(+)
New commits: commit 23e9a4cf1eec75cdd40a695ecae2af9b952178d3 Author: Armin Le Grand (allotropia) <armin.le.grand.ext...@allotropia.de> AuthorDate: Fri Nov 10 17:59:11 2023 +0100 Commit: Armin Le Grand <armin.le.gr...@me.com> CommitDate: Fri Nov 10 20:05:11 2023 +0100 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.gr...@me.com> 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")