X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/8601b2e15bf924d4be6b7843064028e514a71ec8..01cb1c26171efc494b94d77e4351362bb0eb2e7d:/src/univ/menu.cpp diff --git a/src/univ/menu.cpp b/src/univ/menu.cpp index 1a70ef1eb4..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; } // ----------------------------------------------------------------------------