Bug 471391

Summary: Crash after creating text object and undoing it
Product: [Applications] krita Reporter: Alvin Wong <alvin>
Component: GeneralAssignee: Krita Bugs <krita-bugs-null>
Status: RESOLVED FIXED    
Severity: crash Keywords: regression
Priority: NOR    
Version First Reported In: git master (please specify the git hash!)   
Target Milestone: ---   
Platform: Microsoft Windows   
OS: Microsoft Windows   
Latest Commit: Version Fixed In:
Sentry Crash Report:
Attachments: Crash backtrace

Description Alvin Wong 2023-06-23 15:54:57 UTC
Created attachment 159863 [details]
Crash backtrace

SUMMARY
Creating a text object then undoing it causes a crash.


STEPS TO REPRODUCE
1. Create new file
2. Add text object
3. Close text edit dialog
4. Press Ctrl+Z (Undo)

OBSERVED RESULT
Crash

EXPECTED RESULT
Shouldn't crash

SOFTWARE/OS VERSIONS
Windows: 10
Krita: base is 48d357256, can also reproduce on nightly 6d578e3bbb

ADDITIONAL INFORMATION
Doesn't seem to happen on 219e7b9285
Comment 1 Bug Janitor Service 2023-06-27 10:15:23 UTC
A possibly relevant merge request was started @ https://invent.kde.org/graphics/krita/-/merge_requests/1840
Comment 2 Dmitry Kazakov 2023-06-27 12:23:08 UTC
Git commit f56ac428f86b28919f338e4dde2594056ce6a681 by Dmitry Kazakov, on behalf of Alvin Wong.
Committed on 27/06/2023 at 12:22.
Pushed by dkazakov into branch 'master'.

Fix weak shared ptr deref for some layer updates

Convert ithe image weak shared ptr to strong reference and properly
check for null before accessing its members.

Fixes regression from 205731b2aa5ab530cbd145cb32dac4796bac23a3.

M  +1    -1    libs/image/generator/kis_generator_layer.cpp
M  +5    -3    libs/image/kis_transform_mask.cpp
M  +7    -4    libs/ui/flake/kis_shape_layer_canvas.cpp

https://invent.kde.org/graphics/krita/-/commit/f56ac428f86b28919f338e4dde2594056ce6a681