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

This commit is contained in:
GabsPuNs
2026-05-28 18:58:35 -04:00
parent d7add3be09
commit 338604d7c5
4 changed files with 12 additions and 8 deletions

View File

@@ -20,7 +20,8 @@ void LightningBoltRenderer::render(shared_ptr<Entity> _bolt, double x, double y,
double xOff = 0;
double zOff = 0;
{
Random *random = new Random(bolt->seed);
Random randomObj(bolt->seed);
Random *random = &randomObj;
for (int h = 7; h >= 0; h--)
{
xOffs[h] = xOff;
@@ -32,7 +33,8 @@ void LightningBoltRenderer::render(shared_ptr<Entity> _bolt, double x, double y,
for (int r = 0; r < 4; r++)
{
Random *random = new Random(bolt->seed);
Random randomObj(bolt->seed);
Random *random = &randomObj;
for (int p = 0; p < 3; p++)
{
int hs = 7;