Fix possible crashes while switching from design to preview

Authored by staniek on Apr 19 2017, 11:43 AM.



(protect ORODocument pointer more in KReportPage and KReportView)



Test Plan

Open report in Kexi, change views a few times. Result: rendering no longer crashes while new document is generated.

Diff Detail

R14 KReport
Automatic diff as part of commit; lint not applicable.
Automatic diff as part of commit; unit tests not applicable.
staniek created this revision.Apr 19 2017, 11:43 AM
Restricted Application added a project: KReport. · View Herald TranscriptApr 19 2017, 11:43 AM
piggz edited edge metadata.Apr 24 2017, 11:05 AM

Do we understand the crash?

In D5508#104272, @piggz wrote:

Do we understand the crash?

In KexiReportView::afterSwitchFrom() m_preRenderer->generateDocument() is called but the ORODocument pointer is updated later in the m_reportView->setDocument() call. We are checking for existence of the pointer but it was a dangling pointer.

BTW, the issue is only observed in Kexi because of the way how KReport is used (setting a new document object).

piggz accepted this revision.Apr 24 2017, 12:02 PM
This revision is now accepted and ready to land.Apr 24 2017, 12:02 PM
This revision was automatically updated to reflect the committed changes.
staniek edited the summary of this revision. (Show Details)Apr 24 2017, 7:19 PM