Skip to content

Commit e3353c4

Browse files
gh-111531: Tkinter: fix reference leaks in bind_class() and bind_all() (GH-111533)
1 parent 3dbaed3 commit e3353c4

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

Lib/tkinter/__init__.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -1538,7 +1538,7 @@ def bind_all(self, sequence=None, func=None, add=None):
15381538
An additional boolean parameter ADD specifies whether FUNC will
15391539
be called additionally to the other bound function or whether
15401540
it will replace the previous function. See bind for the return value."""
1541-
return self._bind(('bind', 'all'), sequence, func, add, 0)
1541+
return self._root()._bind(('bind', 'all'), sequence, func, add, True)
15421542

15431543
def unbind_all(self, sequence):
15441544
"""Unbind for all widgets for event SEQUENCE all functions."""
@@ -1552,7 +1552,7 @@ def bind_class(self, className, sequence=None, func=None, add=None):
15521552
whether it will replace the previous function. See bind for
15531553
the return value."""
15541554

1555-
return self._bind(('bind', className), sequence, func, add, 0)
1555+
return self._root()._bind(('bind', className), sequence, func, add, True)
15561556

15571557
def unbind_class(self, className, sequence):
15581558
"""Unbind for all widgets with bindtag CLASSNAME for event SEQUENCE
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
Fix reference leaks in ``bind_class()`` and ``bind_all()`` methods of
2+
:mod:`tkinter` widgets.

0 commit comments

Comments
 (0)