diff options
-rw-r--r-- | sfx2/source/doc/sfxbasemodel.cxx | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/sfx2/source/doc/sfxbasemodel.cxx b/sfx2/source/doc/sfxbasemodel.cxx index d57fe3435f85..9987acf9b5db 100644 --- a/sfx2/source/doc/sfxbasemodel.cxx +++ b/sfx2/source/doc/sfxbasemodel.cxx @@ -3062,9 +3062,12 @@ 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 + // keep m_pData alive, if notified target would dispose the document std::shared_ptr<IMPL_SfxBaseModel_DataContainer> pData(m_pData); + // also make sure this object doesn't self-destruct while notifying + rtl::Reference<SfxBaseModel> self(this); + DBG_ASSERT( !aName.isEmpty(), "Empty event name!" ); if (aName.isEmpty()) return; |