]> git.saurik.com Git - wxWidgets.git/commitdiff
Don't crash in wxMenuBar::Remove() if unattached in wxGTK.
authorVadim Zeitlin <vadim@wxwidgets.org>
Wed, 26 Sep 2012 22:29:14 +0000 (22:29 +0000)
committerVadim Zeitlin <vadim@wxwidgets.org>
Wed, 26 Sep 2012 22:29:14 +0000 (22:29 +0000)
It should be possible to remove a menu from a menu bar even before it is
attached to a frame without crashing.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@72558 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

src/gtk/menu.cpp

index fe3ebb03a353acdea456d35e4b425dc9c9e14f51..f0b8b6ff9e5452a85a90bd7ba73c2595a3a41e3a 100644 (file)
@@ -339,7 +339,8 @@ wxMenu *wxMenuBar::Remove(size_t pos)
     gtk_widget_destroy( menu->m_owner );
     menu->m_owner = NULL;
 
-    DetachFromFrame( menu, m_menuBarFrame );
+    if ( m_menuBarFrame )
+        DetachFromFrame( menu, m_menuBarFrame );
 
     return menu;
 }