Skip to content

Commit 1cb8580

Browse files
committed
Fix mem leaks in the demo
1 parent 7839670 commit 1cb8580

File tree

2 files changed

+4
-0
lines changed

2 files changed

+4
-0
lines changed

demo/demo/agents/fireball/fireball.gd

+2
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,8 @@ func _physics_process(delta: float) -> void:
4141

4242

4343
func _die() -> void:
44+
if _is_dead:
45+
return
4446
_is_dead = true
4547
trail.emitting = false
4648
root.hide()

demo/demo/agents/ninja_star/ninja_star.gd

+2
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,8 @@ func _physics_process(delta: float) -> void:
3939

4040

4141
func _die() -> void:
42+
if _is_dead:
43+
return
4244
_is_dead = true
4345
root.hide()
4446
collision_shape_2d.set_deferred(&"disabled", true)

0 commit comments

Comments
 (0)