X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/1dddf8389fef10a535dbcc96f5323799a852ade8..61f0d452ea7e47fea18d0ab748095dc42d7dd66d:/src/common/menucmn.cpp?ds=sidebyside diff --git a/src/common/menucmn.cpp b/src/common/menucmn.cpp index 6c2e5631a7..ae70495bef 100644 --- a/src/common/menucmn.cpp +++ b/src/common/menucmn.cpp @@ -51,7 +51,8 @@ WX_DEFINE_LIST(wxMenuItemList); wxMenuItemBase::~wxMenuItemBase() { - delete m_subMenu; + if (m_subMenu) + delete m_subMenu; } #if wxUSE_ACCEL @@ -128,7 +129,8 @@ void wxMenuBase::Init(long style) wxMenuBase::~wxMenuBase() { - // nothing to do, wxMenuItemList dtor will delete the menu items + // nothing to do, wxMenuItemList dtor will delete the menu items. + // Actually, in GTK, the submenus have to get deleted first. } // ----------------------------------------------------------------------------