From: Vadim Zeitlin Date: Wed, 26 Sep 2012 22:29:14 +0000 (+0000) Subject: Don't crash in wxMenuBar::Remove() if unattached in wxGTK. X-Git-Url: https://git.saurik.com/wxWidgets.git/commitdiff_plain/64b788642dc8c3338a2230be35f50db28e117e3d Don't crash in wxMenuBar::Remove() if unattached in wxGTK. 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 --- diff --git a/src/gtk/menu.cpp b/src/gtk/menu.cpp index fe3ebb03a3..f0b8b6ff9e 100644 --- a/src/gtk/menu.cpp +++ b/src/gtk/menu.cpp @@ -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; }