Summary: | Libkis documents leak when one of the nodes is a file layer. | ||
---|---|---|---|
Product: | [Applications] krita | Reporter: | wolthera <griffinvalley> |
Component: | Scripting | Assignee: | Krita Bugs <krita-bugs-null> |
Status: | RESOLVED FIXED | ||
Severity: | crash | CC: | halla |
Priority: | NOR | ||
Version: | git master (please specify the git hash!) | ||
Target Milestone: | --- | ||
Platform: | Other | ||
OS: | Linux | ||
Latest Commit: | Version Fixed In: |
Description
wolthera
2018-02-21 16:17:45 UTC
Ah, safe asserts ought to be crashes, apparantly. What does your script look like? If I run the following in Scripter, I do not get a crash: ------------------------ def test(): d = Application.createDocument(100, 100, "Test", "RGBA", "U8", "", 120.0) root = d.rootNode(); print(root.childNodes()) l2 = d.createFileLayer("fl", "/home/boud/Pictures/environments-16-ziggurat-view_1920x489.png", "ImageToSize") print(l2) root.addChildNode(l2, None) print(root.childNodes()) d.close() test() -------------------------------- Uhm, well, I noticed it when running the comic project management tools, and that it only happened with a layer which contents contained file layers. I cannot reproduce it with your script either. Are you sure it produces a valid file layer? I do get it with: ------------------- import sys from krita import * def test(): d = Application.openDocument(Application.recentDocuments()[-1]) root = d.rootNode(); print(root.childNodes()) l2 = d.createFileLayer("fl", "/home/boud/Pictures/environments-16-ziggurat-view_1920x489.png", "ImageToSize") print(l2) root.addChildNode(l2, None) print(root.childNodes()) d.close() test() ------------------- Where the last document I had open was a file with a file layer. Before you ask, yes, I did try changing the file layer url in the script to something else, but it made no difference to creating it. Curious: I get this on the output: "Test" Cloning KisFileLayer "../environments-16-ziggurat-view_1920x489.png" SAFE ASSERT (krita): "QFile::exists(path())" in file /home/boud/dev/krita/libs/ui/kis_file_layer.cpp, line 80 And the resulting file misses the Pictures part of the url. I wonder what's up with that. Git commit b254dbad8019427b22b357284ef5b33c9698a4d5 by Boudewijn Rempt. Committed on 23/02/2018 at 15:49. Pushed by rempt into branch 'master'. Do not set the url of the document based on the name This leads to strange bugs because the url is set to Pictures/name, but the document hasn't been saved yet. Related: bug 297989 M +1 -4 libs/ui/KisDocument.cpp https://commits.kde.org/krita/b254dbad8019427b22b357284ef5b33c9698a4d5 Damn, it still doesn't work. Now I get ../../ in the path to the file layer. Git commit 4e59102de741707c846ace7962e47993fac5566b by Boudewijn Rempt. Committed on 27/02/2018 at 13:20. Pushed by rempt into branch 'master'. scripting: Temporarily set the saveAs url on the document Otherwise the document might have an empty or wrong url and saving file layers is broken. This doesn't fix 390853' hitting a safe_assert in the KisDocument destructor, though. M +3 -1 libs/libkis/Document.cpp https://commits.kde.org/krita/4e59102de741707c846ace7962e47993fac5566b Okay, now it seems to work fine for me. The only way to get an assert is now by closing krita, opening a document with a file layer and closing Krita; that's, howebver, not relevant to this bug. |