Bug 457080

Summary: Crash when cloning documents and adding a view for them.
Product: [Applications] krita Reporter: wolthera <griffinvalley>
Component: ScriptingAssignee: Krita Bugs <krita-bugs-null>
Status: RESOLVED FIXED    
Severity: crash    
Priority: NOR    
Version: 5.0.8   
Target Milestone: ---   
Platform: Other   
OS: Linux   
Latest Commit: Version Fixed In:

Description wolthera 2022-07-24 15:42:09 UTC
SUMMARY

The following script keeps crashing because of a safe assert:

```

from krita import *

doc = Krita.instance().activeDocument()
newDoc = doc.clone()
Krita.instance().activeWindow().addView(newDoc)

```

I am testing this in the 5.1 beta 2 appimage, but the person who found this was in 5.0.8

The safe assert is:
SAFE ASSERT (krita): "!sanityCheckPointer.isValid()" in file /home/appimage/workspace/Krita_Nightly_Appimage_Build/krita/libs/ui/KisDocument.cpp, line 676
Comment 1 Dmitry Kazakov 2022-07-26 12:25:00 UTC
Git commit 2b1c570f36caa46c829e7d3abb747aa8bce8fbdf by Dmitry Kazakov.
Committed on 26/07/2022 at 12:24.
Pushed by dkazakov into branch 'master'.

Fix a crash when tring to clone document via Python plugin

M  +5    -2    libs/libkis/Document.cpp
M  +4    -9    plugins/dockers/advancedcolorselector/kis_color_selector_container.cpp

https://invent.kde.org/graphics/krita/commit/2b1c570f36caa46c829e7d3abb747aa8bce8fbdf
Comment 2 Dmitry Kazakov 2022-07-26 12:25:03 UTC
Git commit 578ee9e068a460c5944759c016073d34a3073802 by Dmitry Kazakov.
Committed on 26/07/2022 at 12:24.
Pushed by dkazakov into branch 'krita/5.1'.

Fix a crash when tring to clone document via Python plugin

M  +5    -2    libs/libkis/Document.cpp
M  +4    -9    plugins/dockers/advancedcolorselector/kis_color_selector_container.cpp

https://invent.kde.org/graphics/krita/commit/578ee9e068a460c5944759c016073d34a3073802