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
This commit is contained in:
Vadim Zeitlin
2012-09-26 22:29:14 +00:00
parent f3128ca17d
commit 64b788642d

View 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;
}