https://bugs.kde.org/show_bug.cgi?id=390725

Boudewijn Rempt <b...@valdyas.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |RESOLVED
         Resolution|---                         |FIXED

--- Comment #5 from Boudewijn Rempt <b...@valdyas.org> ---
Once d.close() is called, no errors happen (at least not anymore after today's
commits). However, there's still a gotcha when running stuff from scripter.
Everything that's run in scripter's top-level context will not be deleted when
the script is done.


from krita import *
d = Application.createDocument()
root = d.rootNode()
d.close()

This will close and delete the document created; it will not delete the "root"
object, because the "root" object is in the global Python context and will only
be removed when Krita exits. It will also keep a strong reference to the
document's image's root KisNode, which means that that won't be deleted either
until the Python plugin is unloaded.

The solution for now is to run code in another context, for instance:

from krita import *

def test():
    d = Application.createDocument()
    root = d.rootNode()
    d.close()

test()

-- 
You are receiving this mail because:
You are watching all bug changes.

Reply via email to