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

New commits:
commit dd23a46172e40c6c1a094e4ed5c38c8e9651f13b
Author:     Armin Le Grand (allotropia) <armin.le.grand.ext...@allotropia.de>
AuthorDate: Fri Dec 16 16:57:46 2022 +0100
Commit:     Armin Le Grand (allotropia) <armin.le.grand.ext...@allotropia.de>
CommitDate: Mon Dec 19 16:35:20 2022 +0100

    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 <thorsten.behr...@allotropia.de>

diff --git a/sfx2/source/doc/sfxbasemodel.cxx b/sfx2/source/doc/sfxbasemodel.cxx
index 44cd4216bece..581f90149adf 100644
--- a/sfx2/source/doc/sfxbasemodel.cxx
+++ b/sfx2/source/doc/sfxbasemodel.cxx
@@ -3246,7 +3246,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);
@@ -3259,7 +3259,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