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 mdehoon
Recipients
Date 2005-02-12.06:02:58
SpamBayes Score
Marked as misclassified
Message-id
In-reply-to
Content
In the _loadtk method of the class Tk, there are two
calls self.tk.createcommand, one for 'tkerror' and one
for 'exit'. In the createcommand function in
_tkinter.c, there is a Py_XINCREF for the Tk widget and
one for the Python function (_tkerror or _exit). The
corresponding Py_XDECREFs are called (via
Tkapp_DeleteCommand) in PythonCmdDelete. The
Tkapp_DeleteCommand is called by the deletecommand in
the destroy method of class Misc in Tkinter.py.
However, the deletecommand is called only for commands
listed in self._tclCommands. Now, if a command is
created via the _register method in class Misc, the
command is appended to self._tclCommands. However, the
'tkerror' and 'exit' commands, created in the _loadtk
method of the class Tk, are not appended to
self._tclCommands. Hence, the '_tkerror' and '_exit'
functions as well as the Tk widget itself have an
incorrect reference count. The Tkapp_Dealloc routine in
_tkinter.c is not called and the Tk widget is not
destroyed.
The attached patch simply adds a
self._tclCommands.append for 'tkerror' and 'exit'. With
this patch, a Tk widget is destroyed and Tkapp_Dealloc
is called correctly.
History
Date User Action Args
2007-08-23 15:41:49adminlinkissue1121234 messages
2007-08-23 15:41:49admincreate