gh-111531: Tkinter: fix reference leaks in bind_class() and bind_all() (GH-111533)

This commit is contained in:
Serhiy Storchaka 2023-10-31 08:48:52 +02:00 committed by GitHub
parent 3dbaed3caa
commit e3353c498d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 2 deletions

View File

@ -1538,7 +1538,7 @@ class Misc:
An additional boolean parameter ADD specifies whether FUNC will
be called additionally to the other bound function or whether
it will replace the previous function. See bind for the return value."""
return self._bind(('bind', 'all'), sequence, func, add, 0)
return self._root()._bind(('bind', 'all'), sequence, func, add, True)
def unbind_all(self, sequence):
"""Unbind for all widgets for event SEQUENCE all functions."""
@ -1552,7 +1552,7 @@ class Misc:
whether it will replace the previous function. See bind for
the return value."""
return self._bind(('bind', className), sequence, func, add, 0)
return self._root()._bind(('bind', className), sequence, func, add, True)
def unbind_class(self, className, sequence):
"""Unbind for all widgets with bindtag CLASSNAME for event SEQUENCE

View File

@ -0,0 +1,2 @@
Fix reference leaks in ``bind_class()`` and ``bind_all()`` methods of
:mod:`tkinter` widgets.