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

This commit is contained in:
Zero
2026-05-26 15:47:43 +03:00
committed by GitHub
parent 285fab70b2
commit 544befe162
7 changed files with 39 additions and 2 deletions
+10
View File
@@ -8,6 +8,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++)
@@ -19,6 +28,7 @@ void GuiParticles::tick()
if (gp->removed)
{
delete gp;
particles.erase(particles.begin()+i);
i--;
}