sw/source/core/layout/ssfrm.cxx |    4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

New commits:
commit 12233f437e6299e6dcea3ee1490a80da2bef2372
Author:     Caolán McNamara <caol...@redhat.com>
AuthorDate: Wed Mar 15 20:06:05 2023 +0000
Commit:     Caolán McNamara <caol...@redhat.com>
CommitDate: Thu Mar 16 13:08:03 2023 +0000

    Related: tdf#154205 avoid use of destroyed ViewShell
    
    Change-Id: Ife553269e0cdeb331931a885a3dd4f87c1c3d9bb
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/148940
    Tested-by: Jenkins
    Reviewed-by: Caolán McNamara <caol...@redhat.com>

diff --git a/sw/source/core/layout/ssfrm.cxx b/sw/source/core/layout/ssfrm.cxx
index aef3dad2827d..c36a7de33e5f 100644
--- a/sw/source/core/layout/ssfrm.cxx
+++ b/sw/source/core/layout/ssfrm.cxx
@@ -23,6 +23,7 @@
 #include <rootfrm.hxx>
 #include <dcontact.hxx>
 #include <flyfrm.hxx>
+#include <tabfrm.hxx>
 #include <txtfrm.hxx>
 #include <cellfrm.hxx>
 #include <swtable.hxx>
@@ -336,8 +337,9 @@ void SwFrame::DestroyImpl()
         && (GetDep() || IsTextFrame())) // sw_redlinehide: text frame may not 
have Dep!
     {
         assert(!IsTextFrame() || GetDep() || 
static_cast<SwTextFrame*>(this)->GetMergedPara());
+        const bool bInDocDtor = IsTabFrame() && 
static_cast<SwTabFrame*>(this)->GetFormat()->GetDoc()->IsInDtor();
         SwRootFrame *pRootFrame = getRootFrame();
-        if( pRootFrame && pRootFrame->IsAnyShellAccessible() )
+        if( !bInDocDtor && pRootFrame && pRootFrame->IsAnyShellAccessible() )
         {
             SwViewShell *pVSh = pRootFrame->GetCurrShell();
             if( pVSh && pVSh->Imp() )

Reply via email to