wxMenuItemBase::~wxMenuItemBase()
{
- delete m_subMenu;
+ if (m_subMenu)
+ delete m_subMenu;
}
#if wxUSE_ACCEL
m_style = style;
m_clientData = (void *)NULL;
m_eventHandler = this;
+
+#if wxUSE_MENU_CALLBACK
+ m_callback = (wxFunction) NULL;
+#endif // wxUSE_MENU_CALLBACK
}
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.
}
// ----------------------------------------------------------------------------