summaryrefslogtreecommitdiff
path: root/source/kde/patch/calligra/0065-Backport-Plan-Fix-crash-due-to-accessing-deleted-obj.patch
blob: b3f38d475f892a7840109190b9673c9cd1d98e88 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
From 7c64caec3022b28775ea85864eef47bf2ac51066 Mon Sep 17 00:00:00 2001
From: Dag Andersen <danders@get2net.dk>
Date: Mon, 22 Aug 2016 08:49:13 +0200
Subject: [PATCH 65/80] Backport: Plan: Fix crash due to accessing deleted
 object

KReportDesigner takes ownership of reportdata, so give it a clone it can delete
---
 plan/libs/ui/reports/reportview.cpp | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/plan/libs/ui/reports/reportview.cpp b/plan/libs/ui/reports/reportview.cpp
index 462a31d..8552790 100644
--- a/plan/libs/ui/reports/reportview.cpp
+++ b/plan/libs/ui/reports/reportview.cpp
@@ -1250,10 +1250,10 @@ void ReportDesigner::createDockers()
 
 void ReportDesigner::setReportData( const QString &tag )
 {
-
+    emit optionsModified();
     ReportData *rd = Report::findReportData( m_reportdatamodels, tag );
-    if ( rd != m_designer->reportData() ) {
-        emit optionsModified();
+    if ( rd ) {
+        rd = rd->clone(); // KReportDesigner takes ownership, so give it a clone it can delete
     }
     m_designer->setReportData( rd );
 
-- 
2.7.4