From 82302ad45a9d919460bdeeca69efedbc3f0836d7 Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Wed, 10 Nov 2010 00:36:55 +0000 Subject: [PATCH] Disconnect "hide" menu signal to fix menu destruction in wxGTK. The "hide" signal handler was triggered when destroying a sub-menu (even if it was not shown at this time). Disconnect it to avoid asserts due to attempts to generate an event for an already detached menu and to avoid the (bogus) wxEVT_MENU_CLOSE event as well. Closes #12668. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@66082 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- src/gtk/menu.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/gtk/menu.cpp b/src/gtk/menu.cpp index 53869105fb..d4e961b241 100644 --- a/src/gtk/menu.cpp +++ b/src/gtk/menu.cpp @@ -719,6 +719,11 @@ void wxMenu::Init() wxMenu::~wxMenu() { + // Destroying a menu generates a "hide" signal even if it's not shown + // currently, so disconnect it to avoid dummy wxEVT_MENU_CLOSE events + // generation. + g_signal_handlers_disconnect_by_func(m_menu, (gpointer)menu_hide, this); + // see wxMenu::Init g_object_unref(m_menu); -- 2.45.2