Fixed context menu crash on OS X (GAL).

This commit is contained in:
Maciej Suminski 2015-05-18 13:48:12 +02:00
parent cbb86c3b9c
commit 6788e31a1e
1 changed files with 4 additions and 2 deletions

View File

@ -48,8 +48,10 @@ void CONDITIONAL_MENU::AddSeparator( const SELECTION_CONDITION& aCondition, int
CONTEXT_MENU& CONDITIONAL_MENU::Generate( SELECTION& aSelection )
{
// Clear, but do not delete entries - they are going to be reused
m_menu.GetMenuItems().clear();
wxMenuItemList items = m_menu.GetMenuItems();
for( wxMenuItemList::iterator it = items.begin(); it != items.end(); ++it )
m_menu.Remove( (*it) );
for( std::list<ENTRY>::iterator it = m_entries.begin(); it != m_entries.end(); ++it )
{