Summary: | Was painting and suddenly Krita crashed (GDB backtrace) | ||
---|---|---|---|
Product: | [Applications] krita | Reporter: | wolthera <griffinvalley> |
Component: | General | Assignee: | Krita Bugs <krita-bugs-null> |
Status: | RESOLVED FIXED | ||
Severity: | crash | CC: | halla |
Priority: | NOR | ||
Version First Reported In: | git master (please specify the git hash!) | ||
Target Milestone: | --- | ||
Platform: | Compiled Sources | ||
OS: | Linux | ||
Latest Commit: | http://commits.kde.org/krita/ebc8a43ce07b6152abfb2fb88509c4bad1439f46 | Version Fixed In: | |
Sentry Crash Report: |
Description
wolthera
2016-08-12 21:20:16 UTC
And that's why code like QRect rect = temporaryTarget() ? temporaryTarget()->extent() : QRect(); is bad. Sure, it saves some lines, but it is _wrong_. Git commit ebc8a43ce07b6152abfb2fb88509c4bad1439f46 by Boudewijn Rempt. Committed on 13/08/2016 at 09:14. Pushed by rempt into branch 'master'. A line like QRect rect = temporaryTarget() ? temporaryTarget()->extent() : QRect(); is dangerous, since the paint device might be gone between the check and the use. It's better to get a local shared pointer to the paint device and check that. M +5 -3 libs/image/kis_paint_layer.cc M +10 -6 libs/ui/tool/strokes/kis_painter_based_stroke_strategy.cpp M +9 -5 plugins/tools/basictools/strokes/move_selection_stroke_strategy.cpp http://commits.kde.org/krita/ebc8a43ce07b6152abfb2fb88509c4bad1439f46 |