Menu frees any added items

This commit is contained in:
Simon Robertshaw 2012-06-18 15:27:57 +01:00
parent 741392f2c1
commit 9d7a4e55f2
2 changed files with 9 additions and 4 deletions

View File

@ -170,10 +170,6 @@ GameModel::~GameModel()
for(int i = 0; i < menuList.size(); i++) for(int i = 0; i < menuList.size(); i++)
{ {
for(int j = 0; i < menuList[i]->GetToolList().size(); i++)
{
delete menuList[i]->GetToolList()[j];
}
delete menuList[i]; delete menuList[i];
} }
for(int i = 0; i < brushList.size(); i++) for(int i = 0; i < brushList.size(); i++)

View File

@ -24,6 +24,15 @@ public:
} }
virtual ~Menu()
{
for(int i = 0; i < tools.size(); i++)
{
delete tools[i];
}
tools.clear();
}
vector<Tool*> GetToolList() vector<Tool*> GetToolList()
{ {
return tools; return tools;