Fix for a crash when saving a document after adding a text shape
ClosedPublic

Authored by dkazakov on Nov 22 2016, 11:17 AM.

Details

Summary

This patch should fix a crash that happens after
KisShapeLayerCanvas::repaint() is called on a cloned image. Actually,
KisShapeLayer::setImage() was implemented incorrectly. It deleted
m_d->converter and m_d->paintDevice, although canvas still owned a link
to them. Therefore the next coming update crashed the application.

BUG:372357

Test Plan

I could never reproduce the original bug, I only used the results of
Boud's valgrind output. So please test the original bug with the patch
before I push it into 3.1 and impex.

Diff Detail

Repository
R37 Krita
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.
dkazakov updated this revision to Diff 8393.Nov 22 2016, 11:17 AM
dkazakov retitled this revision from to Fix for a crash when saving a document after adding a text shape.
dkazakov updated this object.
dkazakov edited the test plan for this revision. (Show Details)
dkazakov added reviewers: Krita, rempt.
rempt edited edge metadata.Nov 22 2016, 3:31 PM

Yes, on Linux somehow this doesn't lead to a crash though valgrind detects the invalid memory access. I suspect that this is also why vector layers aren't rendered on export to png... I will check this patch tomorrow morning.

rempt accepted this revision.Nov 23 2016, 2:13 PM
rempt edited edge metadata.

Yes, this fixes the crash and the rendering issue.

This revision is now accepted and ready to land.Nov 23 2016, 2:13 PM
This revision was automatically updated to reflect the committed changes.