mirror of
https://github.com/GabsPuNs/Project-Zenith-Main.git
synced 2026-06-10 20:11:58 +00:00
Fix multiple memory leaks and stale pooled allocations (#1)
This commit is contained in:
@@ -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--;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user