Skip to content

Commit

Permalink
Fix crash when BuildMenus() is run with elements in the favorites menu
Browse files Browse the repository at this point in the history
  • Loading branch information
jacob1 committed Jul 24, 2016
1 parent 9cae1f0 commit fe4653c
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/gui/game/GameModel.cpp
Expand Up @@ -233,9 +233,11 @@ void GameModel::BuildMenus()
activeToolIdentifiers[3] = regularToolset[3]->GetIdentifier();

//Empty current menus
for(std::vector<Menu*>::iterator iter = menuList.begin(), end = menuList.end(); iter != end; ++iter)
for (size_t i = 0; i < menuList.size(); i++)
{
delete *iter;
if (i == SC_FAVORITES)
menuList[i]->ClearTools();
delete menuList[i];
}
menuList.clear();
toolList.clear();
Expand Down

0 comments on commit fe4653c

Please sign in to comment.