Bug 488226 - Warning message when closing a document from Python API
Summary: Warning message when closing a document from Python API
Status: CONFIRMED
Alias: None
Product: krita
Classification: Applications
Component: Scripting (show other bugs)
Version: 5.2.3-beta1
Platform: Other Linux
: NOR normal
Target Milestone: ---
Assignee: Krita Bugs
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2024-06-08 21:00 UTC by grum999
Modified: 2024-10-22 21:44 UTC (History)
1 user (show)

See Also:
Latest Commit:
Version Fixed In:
Sentry Crash Report:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description grum999 2024-06-08 21:00:06 UTC
SUMMARY

Found something strange introduced by commit [426f99638a1fa712a6d8ded0eb9a523ef160551b](https://invent.kde.org/graphics/krita/-/commit/426f99638a1fa712a6d8ded0eb9a523ef160551b).

Execute the following script:
```python
from krita import Document

import os.path

newDoc = Krita.instance().createDocument(500, 500, "Test", "RGBA", "U8", "", 300)
newDoc.saveAs(os.path.expanduser("~/test.kra"))
newDoc.close()
```
On Krita built after this commit,  it generate the following warnings (message print 3 times):
```text
WARNING: the destination object of KisSynchronizedConnection has been destroyed during postponed delivery
WARNING: the destination object of KisSynchronizedConnection has been destroyed during postponed delivery
WARNING: the destination object of KisSynchronizedConnection has been destroyed during postponed delivery
```

Before this commit, there's no warnings.

I've tried to understand, but I'm not able to understand the relation ship with Python API here (close an opened document from UI doesn't generate warnings)

STEPS TO REPRODUCE
1. Activate log docker to get warning messages
2. Execute script in scripter


OBSERVED RESULT

Warnings message are produced

EXPECTED RESULT

No warning message

ADDITIONAL INFORMATION
Found commit with git bisect + build appimage
Comment 1 YRH 2024-10-22 21:44:00 UTC
Still reproduced in master @ 1b1422e09a9378a4c1763c41ad895eba299c7264
Observed it on Windows 11 24H2

1. Create a new document
2. Open Log View docker, enable logging
3. Open Scripter, new script, paste the script
4. Execute and the warnings will show in the log view