This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author taleinat
Recipients WKraus, gpolo, serhiy.storchaka, taleinat
Date 2019-08-05.09:57:44
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1564999064.46.0.759319124364.issue36756@roundup.psfhosted.org>
In-reply-to
Content
Tkinter calls Tcl_DeleteInterp when a Tk object is garbage collected, and it registers a cleanup callback for each registered command, which according to the Tcl docs should be called upon Tcl_DeleteInterp[1]. So this must either be a bug in Tcl or something in the circumstances isn't giving it a chance to clean up the commands.

It's worth noting that Tk.destroy() calls Misc.destroy() which explicitly calls deletecommand for all registered commands. So calling .destroy() when done with a Tk instance, which is good practice in general, will also avoid this issue.

Considering the above, I'm not sure this is worth investigating and addressing...

A simple solution could be to add __del__ to Tk or Misc and have that also clean up any registered commands.
History
Date User Action Args
2019-08-05 09:57:44taleinatsetrecipients: + taleinat, gpolo, serhiy.storchaka, WKraus
2019-08-05 09:57:44taleinatsetmessageid: <1564999064.46.0.759319124364.issue36756@roundup.psfhosted.org>
2019-08-05 09:57:44taleinatlinkissue36756 messages
2019-08-05 09:57:44taleinatcreate