]> git.saurik.com Git - wxWidgets.git/blobdiff - src/gtk/menu.cpp
small optimization in wxConfigPathChanger: don't change the path if it is already...
[wxWidgets.git] / src / gtk / menu.cpp
index 5b29ede17789295999e2ba6e3346dbe316d711a0..c72c5a8ee20782ca23730d812e3dbc746f18bd77 100644 (file)
@@ -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.