From d57f8a126cfca58ec3625c6d00be317b48c72229 Mon Sep 17 00:00:00 2001 From: codegirl-007 Date: Fri, 26 Jun 2026 18:08:11 -0700 Subject: [PATCH] fix memory leak in waves by clearing out the recipes before creating a new spawner --- game/app.odin | 1 + game/wave.odin | 1 + 2 files changed, 2 insertions(+) diff --git a/game/app.odin b/game/app.odin index 2445fe5..3fd3318 100644 --- a/game/app.odin +++ b/game/app.odin @@ -14,6 +14,7 @@ run :: proc() { delete(world.path) delete(world.towers) delete(world.events) + delete(world.spawner.recipe) } for !rl.WindowShouldClose() { diff --git a/game/wave.odin b/game/wave.odin index 3eed1dd..eff29ef 100644 --- a/game/wave.odin +++ b/game/wave.odin @@ -19,6 +19,7 @@ start_wave :: proc(world: ^World) { if world.phase != .Build do return world.wave += 1 world.phase = .Combat + delete(world.spawner.recipe) world.spawner = Wave_Spawner { spawn_timer = 0, spawn_interval = 0.55,