To reproduce: - New Impress - Menu: Window/New Window - In new View change to 'Notes' View - In old View insert an Object (e.g. 'Ellipse') -> Lo crashes
Looking into it... Has to do with ChildrenManagerImpl: An already disposed one is used by ChildrenManagerImpl::AddShape getting called. That ChildrenManagerImpl gets already disposed when the 2nd View gets changed to 'Notes' (by ChildrenManagerImpl::impl_dispose() getting called), but it gets not removed from the notify mechanism. This gets triggered by SfxBaseModel::notifyEvent due to the disposed ChildrenManagerImpl being member of m_pData->m_aDocumentEventListeners1. This method already expects RuntimeException(s) and removes the listener in that case. That shows what to do: throw lang::DisposedException() if incarnation is disposed (we have m_bDisposed from the base class comphelper::UnoImplBase to know that). Adding this to ChildrenManagerImpl::notifyEvent solves the problem for AddShape/RemoveShape. NOTE: More member functions of ChildrenManagerImpl may need this.
Armin Le Grand (allotropia) committed a patch related to this issue. It has been pushed to "master": https://git.libreoffice.org/core/commit/23e9a4cf1eec75cdd40a695ecae2af9b952178d3 tdf#158169 take no actions in disposed incarnation It will be available in 24.2.0. The patch should be included in the daily builds available at https://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More information about daily builds can be found at: https://wiki.documentfoundation.org/Testing_Daily_Builds Affected users are encouraged to test the fix and report feedback.
Armin Le Grand (allotropia) committed a patch related to this issue. It has been pushed to "libreoffice-7-6": https://git.libreoffice.org/core/commit/e168e20b519885789cfafbb7d4726d5c79bd2aac tdf#158169 take no actions in disposed incarnation It will be available in 7.6.4. The patch should be included in the daily builds available at https://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More information about daily builds can be found at: https://wiki.documentfoundation.org/Testing_Daily_Builds Affected users are encouraged to test the fix and report feedback.