Message358652
All tkinter objects have a reference to the TCL interpreter object "self.tk". The current cleanup code does not remove these when a widget is destroyed.
Garbage collection of the TCL interpreter object occurs only after all gui objects are garbage collected. This may be triggered from another thread causing TCL to panic and trigger a core dump.
Error message:
>Tcl_AsyncDelete: async handler deleted by the wrong thread
>Aborted (core dumped)
Adding:
"self.tk = None"
to the end of Misc.destroy() (tkinter/__init__.py line:439) should fix this by removing these reference when widgets are destroyed. (Note:destroy is recursive on the widget tree and called on the root object when a Tkinter GUI exits)
I can't see any problem with removing the interpreter object from a widget when it is destroyed. There doesn't seem to be any way to reassign a widget to a new parent so this shouldn't affect anything.
Doing this makes it safe(r) to use tkinter from a non-main thread since if the GUI cleans up properly no "landmines" are left to cause a crash when garbage collected in the wrong thread. |
|
Date |
User |
Action |
Args |
2019-12-19 02:56:56 | obserience | set | recipients:
+ obserience |
2019-12-19 02:56:56 | obserience | set | messageid: <1576724216.68.0.395572121912.issue39093@roundup.psfhosted.org> |
2019-12-19 02:56:56 | obserience | link | issue39093 messages |
2019-12-19 02:56:55 | obserience | create | |
|