fix memory leak in waves by clearing out the recipes before creating a new spawner

This commit is contained in:
2026-06-26 18:08:11 -07:00
parent f2f8f1fe1e
commit d57f8a126c
2 changed files with 2 additions and 0 deletions
+1
View File
@@ -14,6 +14,7 @@ run :: proc() {
delete(world.path)
delete(world.towers)
delete(world.events)
delete(world.spawner.recipe)
}
for !rl.WindowShouldClose() {
+1
View File
@@ -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,