-
Tusooa Windy authored
[1] The fix for a crash when loading a file with ref images in graphics/krita@311d804a 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. BUG: 420051
29e666f9