Fix crash when BuildMenus() is run with elements in the favorites menu
This commit is contained in:
parent
9cae1f0fe7
commit
fe4653c30e
@ -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();
|
||||
|
Reference in New Issue
Block a user