mirror of
https://github.com/python/cpython.git
synced 2025-08-19 08:11:46 +00:00
[3.11] gh-111531: Tkinter: fix reference leaks in bind_class() and bind_all() (GH-111533) (GH-111536)
(cherry picked from commit e3353c498d
)
Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
This commit is contained in:
parent
c5f6c6396d
commit
c66f0bedeb
2 changed files with 4 additions and 2 deletions
|
@ -1459,7 +1459,7 @@ class Misc:
|
||||||
An additional boolean parameter ADD specifies whether FUNC will
|
An additional boolean parameter ADD specifies whether FUNC will
|
||||||
be called additionally to the other bound function or whether
|
be called additionally to the other bound function or whether
|
||||||
it will replace the previous function. See bind for the return value."""
|
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):
|
def unbind_all(self, sequence):
|
||||||
"""Unbind for all widgets for event SEQUENCE all functions."""
|
"""Unbind for all widgets for event SEQUENCE all functions."""
|
||||||
|
@ -1473,7 +1473,7 @@ class Misc:
|
||||||
whether it will replace the previous function. See bind for
|
whether it will replace the previous function. See bind for
|
||||||
the return value."""
|
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):
|
def unbind_class(self, className, sequence):
|
||||||
"""Unbind for all widgets with bindtag CLASSNAME for event SEQUENCE
|
"""Unbind for all widgets with bindtag CLASSNAME for event SEQUENCE
|
||||||
|
|
|
@ -0,0 +1,2 @@
|
||||||
|
Fix reference leaks in ``bind_class()`` and ``bind_all()`` methods of
|
||||||
|
:mod:`tkinter` widgets.
|
Loading…
Add table
Add a link
Reference in a new issue