X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/defc0789c198fe5af4d60fb4804d146807dd48e8..4c420a80e0fb11511b235411875ba5d3e0eb8492:/src/gtk/menu.cpp?ds=inline diff --git a/src/gtk/menu.cpp b/src/gtk/menu.cpp index 5b29ede177..c72c5a8ee2 100644 --- a/src/gtk/menu.cpp +++ b/src/gtk/menu.cpp @@ -982,8 +982,12 @@ wxMenu::~wxMenu() if ( GTK_IS_WIDGET( m_menu )) { - gtk_widget_unref( m_menu ); // see wxMenu::Init - gtk_widget_destroy( m_menu ); + // see wxMenu::Init + gtk_widget_unref( m_menu ); + // if the menu is inserted in another menu at this time, there was + // one more reference to it: + if ( m_owner ) + gtk_widget_destroy( m_menu ); } } @@ -1375,7 +1379,7 @@ static wxString GetHotKey( const wxMenuItem& item ) case WXK_F10: case WXK_F11: case WXK_F12: - hotkey << wxT('F') << code - WXK_F1 + 1; + hotkey += wxString::Format(wxT("F%d"), code - WXK_F1 + 1); break; // TODO: we should use gdk_keyval_name() (a.k.a.