summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Lib/tkinter/__init__.py4
-rw-r--r--Misc/NEWS.d/next/Library/2023-10-31-07-46-56.gh-issue-111531.6zUV_G.rst2
2 files changed, 4 insertions, 2 deletions
diff --git a/Lib/tkinter/__init__.py b/Lib/tkinter/__init__.py
index 47b93d3..0df7f9d 100644
--- a/Lib/tkinter/__init__.py
+++ b/Lib/tkinter/__init__.py
@@ -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
diff --git a/Misc/NEWS.d/next/Library/2023-10-31-07-46-56.gh-issue-111531.6zUV_G.rst b/Misc/NEWS.d/next/Library/2023-10-31-07-46-56.gh-issue-111531.6zUV_G.rst
new file mode 100644
index 0000000..b722f04
--- /dev/null
+++ b/Misc/NEWS.d/next/Library/2023-10-31-07-46-56.gh-issue-111531.6zUV_G.rst
@@ -0,0 +1,2 @@
+Fix reference leaks in ``bind_class()`` and ``bind_all()`` methods of
+:mod:`tkinter` widgets.