From 862086874f35f4508b039aff125ea338548fa068 Mon Sep 17 00:00:00 2001 From: Scott Talbert Date: Fri, 8 Nov 2024 18:39:02 -0500 Subject: [PATCH] Avoid calling FlatMenu Destroy() in a finally block Fixes: https://github.com/wxWidgets/Phoenix/issues/2630 --- wx/lib/agw/flatmenu.py | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/wx/lib/agw/flatmenu.py b/wx/lib/agw/flatmenu.py index 90c52e36..e8678491 100644 --- a/wx/lib/agw/flatmenu.py +++ b/wx/lib/agw/flatmenu.py @@ -5358,10 +5358,8 @@ class FlatMenu(FlatMenuBase): def Destroy(self, *args, **kwargs): - try: - self.Clear() - finally: - return super().Destroy(*args, **kwargs) + self.Clear() + return super().Destroy(*args, **kwargs) def SetMenuBar(self, mb):