https://bugs.kde.org/show_bug.cgi?id=420051
tus...@vista.aero changed: What |Removed |Added ---------------------------------------------------------------------------- Resolution|--- |FIXED Latest Commit| |https://invent.kde.org/grap | |hics/krita/commit/29e666f94 | |178daef0ba5551507d2e388faf4 | |5cf2 Status|CONFIRMED |RESOLVED --- Comment #8 from tus...@vista.aero --- Git commit 29e666f94178daef0ba5551507d2e388faf45cf2 by Tusooa Zhu. Committed on 08/08/2020 at 19:08. Pushed by tusooaw into branch 'master'. Fix ref images layer not shown after switching snapshot [1] The fix for a crash when loading a file with ref images in https://invent.kde.org/graphics/krita/-/commit/311d804aa23f1993ec19513cdd90ad0758627f3c used layer->extent() as a criterion for judging whether "the layer is loaded." However, this criterion is not correct because the real cause of the crash is KisView's d-pointer is not yet initialized, when KisReferenceImagesDecoration is being constructed, which is called by the ctor of KisView::Private. [2] layer->extent() is always empty so the current situation is KisReferenceImagesDecoration::setReferenceImageLayer() is never called, due to the criterion in [1]. [3] This fix added an argument, viewReady, to the constructor of KisReferenceImagesDecoration, so that when it is being called from KisView::Private's constructor, it will not try to update the canvas because that leads to problems. [4] In setReferenceImageLayer, I also modified the logic to not try to dereference a weak pointer before verifying its validity. If I do not do so, it will trigger an assert. M +4 -2 libs/ui/KisDocument.cpp M +11 -7 libs/ui/KisReferenceImagesDecoration.cpp M +2 -2 libs/ui/KisReferenceImagesDecoration.h M +1 -1 libs/ui/KisView.cpp https://invent.kde.org/graphics/krita/commit/29e666f94178daef0ba5551507d2e388faf45cf2 -- You are receiving this mail because: You are watching all bug changes.