Skip to content

Commit

Permalink
Fix mem leaks in the demo
Browse files Browse the repository at this point in the history
  • Loading branch information
limbonaut committed Sep 9, 2024
1 parent 7839670 commit 1cb8580
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
2 changes: 2 additions & 0 deletions demo/demo/agents/fireball/fireball.gd
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,8 @@ func _physics_process(delta: float) -> void:


func _die() -> void:
if _is_dead:
return
_is_dead = true
trail.emitting = false
root.hide()
Expand Down
2 changes: 2 additions & 0 deletions demo/demo/agents/ninja_star/ninja_star.gd
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,8 @@ func _physics_process(delta: float) -> void:


func _die() -> void:
if _is_dead:
return
_is_dead = true
root.hide()
collision_shape_2d.set_deferred(&"disabled", true)
Expand Down

0 comments on commit 1cb8580

Please sign in to comment.