Deref image shared pointers before calling ~KisDocument (#396985)
ClosedPublic

Authored by Beuc on Dec 20 2018, 11:55 AM.

Details

Summary

Call the implicit KisImageSP destructor with scoping.

Alternatively, we could remove the:

// check if the image has actually been deleted
KIS_SAFE_ASSERT_RECOVER_NOOP(!sanityCheckPointer.isValid());

check from KisDocument which seems a bit possessive about its current image.

Test Plan

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.
Beuc created this revision.Dec 20 2018, 11:55 AM
Restricted Application added a reviewer: Krita. · View Herald TranscriptDec 20 2018, 11:55 AM
Beuc requested review of this revision.Dec 20 2018, 11:55 AM

Hi, @Beuc!

The patch looks correct! Thank you for the fix!

Do you have a commit access to push it, or we should bush it for you?

Beuc added a comment.Dec 20 2018, 5:48 PM

Hi @dkazakov !
I don't have access so feel free to push (I created the patch with git format-patch).

Beuc edited the summary of this revision. (Show Details)Dec 20 2018, 5:49 PM
This revision was not accepted when it landed; it landed in state Needs Review.Dec 25 2018, 6:40 AM
This revision was automatically updated to reflect the committed changes.
Beuc added a comment.Dec 26 2018, 8:33 PM

By the way this patch was intended to the 4.1 branch, you'll want to replicate it there.

In D17708#382477, @Beuc wrote:

By the way this patch was intended to the 4.1 branch, you'll want to replicate it there.

Pushed! Thank you for reminding!