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.
}
// ----------------------------------------------------------------------------
size_t pos;
for ( pos = 0; node; pos++ )
{
- item = node->GetData();
- if ( item->GetId() == id )
+ if ( node->GetData()->GetId() == id )
+ {
+ item = node->GetData();
+
break;
+ }
node = node->GetNext();
}