Fix mem leaks in the demo

This commit is contained in:
Serhii Snitsaruk 2024-09-09 10:22:32 +02:00
parent 78396708d4
commit 1cb85807dd
No known key found for this signature in database
GPG Key ID: A965EF8799FFEC2D
2 changed files with 4 additions and 0 deletions

View File

@ -41,6 +41,8 @@ func _physics_process(delta: float) -> void:
func _die() -> void: func _die() -> void:
if _is_dead:
return
_is_dead = true _is_dead = true
trail.emitting = false trail.emitting = false
root.hide() root.hide()

View File

@ -39,6 +39,8 @@ func _physics_process(delta: float) -> void:
func _die() -> void: func _die() -> void:
if _is_dead:
return
_is_dead = true _is_dead = true
root.hide() root.hide()
collision_shape_2d.set_deferred(&"disabled", true) collision_shape_2d.set_deferred(&"disabled", true)