Skip to content

Commit dde5a99

Browse files
[3.12] gh-111531: Tkinter: fix reference leaks in bind_class() and bind_all() (GH-111533) (GH-111535)
(cherry picked from commit e3353c4) Co-authored-by: Serhiy Storchaka <[email protected]>
1 parent e820d76 commit dde5a99

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
@@ -1459,7 +1459,7 @@ def bind_all(self, sequence=None, func=None, add=None):
14591459
An additional boolean parameter ADD specifies whether FUNC will
14601460
be called additionally to the other bound function or whether
14611461
it will replace the previous function. See bind for the return value."""
1462-
return self._bind(('bind', 'all'), sequence, func, add, 0)
1462+
return self._root()._bind(('bind', 'all'), sequence, func, add, True)
14631463

14641464
def unbind_all(self, sequence):
14651465
"""Unbind for all widgets for event SEQUENCE all functions."""
@@ -1473,7 +1473,7 @@ def bind_class(self, className, sequence=None, func=None, add=None):
14731473
whether it will replace the previous function. See bind for
14741474
the return value."""
14751475

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

14781478
def unbind_class(self, className, sequence):
14791479
"""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)