summaryrefslogtreecommitdiff
path: root/sw/source/core/inc/frame.hxx
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2019-07-19 16:56:12 +0100
committerCaolán McNamara <caolanm@redhat.com>2019-07-21 18:17:16 +0200
commit135c1d6d0acd7270237f0a2410507114e7c14129 (patch)
tree118c5b27864128ea3bcd1c3614f42bfa4f21b4b1 /sw/source/core/inc/frame.hxx
parent01782ecd9fb1e712925cdeb29694faad3c6beed7 (diff)
crashtesting: failures on swfootnoteframe_colunlock_heap_use_after_free.sample
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 <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'sw/source/core/inc/frame.hxx')
-rw-r--r--sw/source/core/inc/frame.hxx15
1 files changed, 13 insertions, 2 deletions
diff --git a/sw/source/core/inc/frame.hxx b/sw/source/core/inc/frame.hxx
index ab1047d0348f..6e0d653690c4 100644
--- a/sw/source/core/inc/frame.hxx
+++ b/sw/source/core/inc/frame.hxx
@@ -1237,8 +1237,19 @@ public:
//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
- explicit SwFrameDeleteGuard(SwFrame* pFrame);
- ~SwFrameDeleteGuard();
+ explicit SwFrameDeleteGuard(SwFrame* pFrame)
+ : m_pForbidFrame((pFrame && !pFrame->IsDeleteForbidden()) ?
+ pFrame : nullptr)
+ {
+ if (m_pForbidFrame)
+ m_pForbidFrame->ForbidDelete();
+ }
+
+ ~SwFrameDeleteGuard()
+ {
+ if (m_pForbidFrame)
+ m_pForbidFrame->AllowDelete();
+ }
};
typedef long (SwFrame:: *SwFrameGet)() const;