From 52834445ded0fc7395c463d73996a0e803b463f4 Mon Sep 17 00:00:00 2001 From: Nerogar Date: Sat, 11 Nov 2023 16:45:53 +0100 Subject: [PATCH] fixed an exception when destroying an entry and updating the text variable --- customtkinter/windows/widgets/ctk_entry.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/customtkinter/windows/widgets/ctk_entry.py b/customtkinter/windows/widgets/ctk_entry.py index db543868..c89d3880 100644 --- a/customtkinter/windows/widgets/ctk_entry.py +++ b/customtkinter/windows/widgets/ctk_entry.py @@ -148,6 +148,10 @@ def destroy(self): if isinstance(self._font, CTkFont): self._font.remove_size_configure_callback(self._update_font) + if self._textvariable_callback_name: + self._textvariable.trace_remove("write", self._textvariable_callback_name) + self._textvariable_callback_name = "" + super().destroy() def _draw(self, no_color_updates=False):