From 135c1d6d0acd7270237f0a2410507114e7c14129 Mon Sep 17 00:00:00 2001 From: Caolán McNamara Date: Fri, 19 Jul 2019 16:56:12 +0100 Subject: crashtesting: failures on swfootnoteframe_colunlock_heap_use_after_free.sample MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit undo forcepoint80 hackery and try a different solution Change-Id: I52b5f9b41074e122bd32e70967e198ce9f86aec7 Reviewed-on: https://gerrit.libreoffice.org/76072 Tested-by: Jenkins Reviewed-by: Caolán McNamara Tested-by: Caolán McNamara --- sw/source/core/layout/ssfrm.cxx | 41 +---------------------------------------- 1 file changed, 1 insertion(+), 40 deletions(-) (limited to 'sw/source/core/layout/ssfrm.cxx') diff --git a/sw/source/core/layout/ssfrm.cxx b/sw/source/core/layout/ssfrm.cxx index 8ff47322e0c0..043752c6d9e9 100644 --- a/sw/source/core/layout/ssfrm.cxx +++ b/sw/source/core/layout/ssfrm.cxx @@ -469,33 +469,6 @@ void SwTextFrame::RegisterToNode(SwTextNode & rNode, bool const isForceNodeAsFir } } -//Flag pFrame for SwFrameDeleteGuard lifetime that we shouldn't delete -//it in e.g. SwSectionFrame::MergeNext etc because we will need it -//again after the SwFrameDeleteGuard dtor -SwFrameDeleteGuard::SwFrameDeleteGuard(SwFrame* pFrame) - : m_pForbidFrame((pFrame && !pFrame->IsDeleteForbidden()) ? pFrame : nullptr) -{ - if (m_pForbidFrame) - { - m_pForbidFrame->ForbidDelete(); - } -} - -SwFrameDeleteGuard::~SwFrameDeleteGuard() -{ - if (m_pForbidFrame) - { - const bool bLogicErrorThrown = !m_pForbidFrame->IsDeleteForbidden(); - if (bLogicErrorThrown) - { - // see testForcepoint80 - SwFrame::DestroyFrame(m_pForbidFrame); - return; - } - m_pForbidFrame->AllowDelete(); - } -} - void SwLayoutFrame::DestroyImpl() { while (!m_VertPosOrientFramesFor.empty()) @@ -510,7 +483,6 @@ void SwLayoutFrame::DestroyImpl() if( GetFormat() && !GetFormat()->GetDoc()->IsInDtor() ) { - bool bFatalError = false; while ( pFrame ) { //First delete the Objs of the Frame because they can't unregister @@ -549,20 +521,9 @@ void SwLayoutFrame::DestroyImpl() } } pFrame->RemoveFromLayout(); - // see testForcepoint80 - if (pFrame->IsDeleteForbidden()) - { - pFrame->AllowDelete(); - bFatalError = true; - } - else - SwFrame::DestroyFrame(pFrame); + SwFrame::DestroyFrame(pFrame); pFrame = m_pLower; } - - if (bFatalError) - throw std::logic_error("DeleteForbidden"); - //Delete the Flys, the last one also deletes the array. while ( GetDrawObjs() && GetDrawObjs()->size() ) { -- cgit v1.2.3