sfx2/source/doc/sfxbasemodel.cxx |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

New commits:
commit 8635c9aa8c6f1078a9e220076d5a08daf30077e8
Author:     Armin Le Grand (allotropia) <[email protected]>
AuthorDate: Fri Dec 16 16:57:46 2022 +0100
Commit:     Thorsten Behrens <[email protected]>
CommitDate: Fri Dec 16 22:25:23 2022 +0000

    Use xKeepAlive instead of m_pData
    
    There is already an instance to keep the incarnation
    alive, but it was not used. Instead m_pData can indeed
    get deleted (nullptr), so better use the alive one.
    
    Change-Id: Icdb6c841408254142561db408f876618adbc0b76
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/144340
    Tested-by: Jenkins
    Reviewed-by: Thorsten Behrens <[email protected]>

diff --git a/sfx2/source/doc/sfxbasemodel.cxx b/sfx2/source/doc/sfxbasemodel.cxx
index 9948aadf0d37..bcdc9f1be845 100644
--- a/sfx2/source/doc/sfxbasemodel.cxx
+++ b/sfx2/source/doc/sfxbasemodel.cxx
@@ -3259,7 +3259,7 @@ void SfxBaseModel::postEvent_Impl( const OUString& aName, 
const Reference< frame
         return;
 
     comphelper::OInterfaceContainerHelper2* pIC =
-        m_pData->m_aInterfaceContainer.getContainer( 
cppu::UnoType<document::XDocumentEventListener>::get());
+        xKeepAlive->m_aInterfaceContainer.getContainer( 
cppu::UnoType<document::XDocumentEventListener>::get());
     if ( pIC )
     {
         SAL_INFO("sfx.doc", "SfxDocumentEvent: " + aName);
@@ -3272,7 +3272,7 @@ void SfxBaseModel::postEvent_Impl( const OUString& aName, 
const Reference< frame
                 aDocumentEvent ) );
     }
 
-    pIC = m_pData->m_aInterfaceContainer.getContainer( 
cppu::UnoType<document::XEventListener>::get());
+    pIC = xKeepAlive->m_aInterfaceContainer.getContainer( 
cppu::UnoType<document::XEventListener>::get());
     if ( pIC )
     {
         SAL_INFO("sfx.doc", "SfxEvent: " + aName);

Reply via email to