X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/e4052bd3e69edb56b59829388fa28a3d10a29ee8..849b176b3d1a9b0df1353b4756a2a64204261f46:/src/univ/menu.cpp diff --git a/src/univ/menu.cpp b/src/univ/menu.cpp index 2f30a0a6d8..62dc90a1c8 100644 --- a/src/univ/menu.cpp +++ b/src/univ/menu.cpp @@ -314,6 +314,12 @@ wxPopupMenuWindow::wxPopupMenuWindow(wxWindow *parent, wxMenu *menu) wxPopupMenuWindow::~wxPopupMenuWindow() { + // When m_popupMenu in wxMenu is deleted because it + // is a child of an old menu bar being deleted (note: it does + // not get destroyed by the wxMenu destructor, but + // by DestroyChildren()), m_popupMenu should be reset to NULL. + + m_menu->m_popupMenu = NULL; } // ---------------------------------------------------------------------------- @@ -1515,7 +1521,7 @@ void wxMenuBar::Init() m_shouldShowMenu = FALSE; - // m_windowStyle |= wxNO_FULL_REPAINT_ON_RESIZE; + m_windowStyle |= wxNO_FULL_REPAINT_ON_RESIZE; } void wxMenuBar::Attach(wxFrame *frame) @@ -2242,7 +2248,7 @@ void wxMenuBar::PopupCurrentMenu(bool selectFirst) wxCHECK_RET( m_current != -1, _T("no menu to popup") ); // forgot to call DismissMenu()? - wxASSERT_MSG( !m_menuShown, _T("shouldn't show two menu at once!") ); + wxASSERT_MSG( !m_menuShown, _T("shouldn't show two menus at once!") ); // in any case, we should show it - even if we won't m_shouldShowMenu = TRUE;