E. Paine <paineeli...@gmail.com> added the comment:

After some initial testing, I have found that while calling Tcl_Finalize  on 
window closure keeps the clipboard contents (as expected), it also finishes the 
Python interpreter.

The solution was to instead use the Tcl_FinalizeThread method, "which you can 
call if you just want to clean up per-thread state" 
(https://www.tcl.tk/man/tcl8.4/TclLib/Exit.htm).

Reading this, I was expecting it to stop further Tk instances from being 
created after the original one was closed, however some initial testing has 
found this to not be true.

I feel it is too early to create a PR for this yet (I need to do more research 
and properly understand the calls), but it is quite possible calling this 
method on root "destroy" is the only thing required to fix this issue.

----------

_______________________________________
Python tracker <rep...@bugs.python.org>
<https://bugs.python.org/issue40452>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to