wxMenuItemBase::~wxMenuItemBase()
{
- delete m_subMenu;
+ if (m_subMenu)
+ delete m_subMenu;
}
#if wxUSE_ACCEL
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.
}
// ----------------------------------------------------------------------------