From b61d8322c3ba00eb2976190ec205aaa8562456c0 Mon Sep 17 00:00:00 2001 From: Kiskadee Date: Sat, 23 Oct 2021 19:46:51 -0300 Subject: [PATCH] Fixed most of the memory leaks, Addresses issue #76 --- character/Barista.gd | 2 +- level/Fridge.gd | 2 +- level/ServingTray.gd | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/character/Barista.gd b/character/Barista.gd index 1174fd4..8e1e0e4 100644 --- a/character/Barista.gd +++ b/character/Barista.gd @@ -113,7 +113,7 @@ func remove_cup(): for item in carry_attachment.get_children(): if item is Cup: cup = item - carry_attachment.remove_child(item) + item.queue_free() if cup: return cup.coffee_type return null diff --git a/level/Fridge.gd b/level/Fridge.gd index 35227b4..fa98903 100644 --- a/level/Fridge.gd +++ b/level/Fridge.gd @@ -98,7 +98,7 @@ func set_using(): yield(tween, "tween_completed") animation_player.play("drinkBeverage") yield(animation_player, "animation_finished") - barista.carry_attachment.remove_child(cold_beverage) + cold_beverage.queue_free() # TODO: convert this into speech baloons func eprint(text: String): diff --git a/level/ServingTray.gd b/level/ServingTray.gd index f2d3732..8c1a25a 100644 --- a/level/ServingTray.gd +++ b/level/ServingTray.gd @@ -116,7 +116,7 @@ func take_items(): return for i in items_container_object.get_children(): var item_type = i.coffee_type - items_container_object.remove_child(i) + i.queue_free() func set_putting(): should_ignore_clicks = false