reportdesign/source/core/sdr/RptModel.cxx |    7 +++++++
 1 file changed, 7 insertions(+)

New commits:
commit 94b9827f790ea1d37c2e128df1e3dc4b57c5f768
Author:     Noel Grandin <noel.gran...@collabora.co.uk>
AuthorDate: Thu Sep 8 09:30:20 2022 +0200
Commit:     Noel Grandin <noel.gran...@collabora.co.uk>
CommitDate: Thu Sep 8 11:47:17 2022 +0200

    tdf#150756 Assertion when opening report for editing
    
    regression from
        commit 8611f6e259b807b4f19c8dc0eab86ca648891ce3
        Author: Noel Grandin <noel.gran...@collabora.co.uk>
        Date:   Thu May 27 10:27:46 2021 +0200
        ref-count SdrObject
    
    Change-Id: Icfdf74035658a6d8222059bb6db36c852a51c4de
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/139632
    Tested-by: Jenkins
    Reviewed-by: Noel Grandin <noel.gran...@collabora.co.uk>

diff --git a/reportdesign/source/core/sdr/RptModel.cxx 
b/reportdesign/source/core/sdr/RptModel.cxx
index 90553afec835..f79c2a214fca 100644
--- a/reportdesign/source/core/sdr/RptModel.cxx
+++ b/reportdesign/source/core/sdr/RptModel.cxx
@@ -54,6 +54,13 @@ 
OReportModel::OReportModel(::reportdesign::OReportDefinition* _pReportDefinition
 
 OReportModel::~OReportModel()
 {
+    // There are some nasty interactions which mean that we have to delete
+    // the pages before we destroy the model - otherwise we will trigger
+    // callbacks which will attempt to recreate SvxShape objects and
+    // fail because the model is being torn down.
+    while (GetPageCount())
+        RemovePage(GetPageCount()-1);
+
     detachController();
 }
 

Reply via email to