summaryrefslogtreecommitdiff
path: root/sfx2
diff options
context:
space:
mode:
authorThorsten Behrens <Thorsten.Behrens@CIB.de>2018-01-26 16:13:23 +0100
committerThorsten Behrens <Thorsten.Behrens@CIB.de>2018-01-27 23:31:33 +0100
commit1841fcf896f50b7df1375d431857ecddd5f5b392 (patch)
treeb7f3c3cacfcfc34bbb8b7e0314f0878e7d99742e /sfx2
parent498deef48de6605193268fb8328fec1053c4ed3c (diff)
tdf#115090 keep internal BaseModel alive long enough
There's reams of code already preventing a close during save (SfxSaveGuard), but this looks equally effective. Avoids SfxBaseModel::dispose() pulling the rug under us, when SfxBaseModel::postEvent_Impl() wants to access parts of the interface containers during notification. Change-Id: Iace1f9922c47a97ab2e798b577c6aec8a729da48 Reviewed-on: https://gerrit.libreoffice.org/48709 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Thorsten Behrens <Thorsten.Behrens@CIB.de>
Diffstat (limited to 'sfx2')
-rw-r--r--sfx2/source/doc/sfxbasemodel.cxx3
1 files changed, 3 insertions, 0 deletions
diff --git a/sfx2/source/doc/sfxbasemodel.cxx b/sfx2/source/doc/sfxbasemodel.cxx
index 4a733eeefd3c..d57fe3435f85 100644
--- a/sfx2/source/doc/sfxbasemodel.cxx
+++ b/sfx2/source/doc/sfxbasemodel.cxx
@@ -3062,6 +3062,9 @@ void SfxBaseModel::postEvent_Impl( const OUString& aName, const Reference< frame
if ( impl_isDisposed() )
return;
+ // keep m_pData alive, if notified target would close the document
+ std::shared_ptr<IMPL_SfxBaseModel_DataContainer> pData(m_pData);
+
DBG_ASSERT( !aName.isEmpty(), "Empty event name!" );
if (aName.isEmpty())
return;