mirror of
https://github.com/The-Powder-Toy/The-Powder-Toy.git
synced 2025-08-29 19:00:33 +02:00
Menu frees any added items
This commit is contained in:
@@ -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++)
|
||||||
|
@@ -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;
|
||||||
|
Reference in New Issue
Block a user