Permalink
Browse files

Fix crash when BuildMenus() is run with elements in the favorites menu

  • Loading branch information...
jacob1 committed Jul 24, 2016
1 parent 9cae1f0 commit fe4653c30e64d6381f41a5de4a1d23edbb28c750
Showing with 4 additions and 2 deletions.
  1. +4 −2 src/gui/game/GameModel.cpp
@@ -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();

0 comments on commit fe4653c

Please sign in to comment.