Fix multiple memory leaks and stale pooled allocations (#1)

This commit is contained in:
GabsPuNs
2026-05-28 18:58:35 -04:00
parent 4024c3f2a4
commit 160044b48f
10 changed files with 46 additions and 5 deletions

View File

@@ -7,6 +7,15 @@ GuiParticles::GuiParticles(Minecraft *mc)
this->mc = mc;
}
GuiParticles::~GuiParticles()
{
for (GuiParticle *gp : particles)
{
delete gp;
}
particles.clear();
}
void GuiParticles::tick()
{
for (unsigned int i = 0; i < particles.size(); i++)
@@ -18,6 +27,7 @@ void GuiParticles::tick()
if (gp->removed)
{
delete gp;
particles.erase(particles.begin()+i);
i--;
}