fix memory leak in waves by clearing out the recipes before creating a new spawner
This commit is contained in:
@@ -14,6 +14,7 @@ run :: proc() {
|
||||
delete(world.path)
|
||||
delete(world.towers)
|
||||
delete(world.events)
|
||||
delete(world.spawner.recipe)
|
||||
}
|
||||
|
||||
for !rl.WindowShouldClose() {
|
||||
|
||||
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user