Quick answer: Godot 4 Tween connecting to finished signal but never disconnecting on tree exit? Disconnect explicitly or bind to a node that auto-cleans.
Tween created in spawn. Connect to finished -> handler. Spawn destroyed; tween outlives; handler fires on missing target.
Connect with bind_node
tween.bind_node(self). Tween auto-kills when self frees; signal cleanup is automatic.
Or disconnect on tree exit
func _exit_tree():
tween.disconnect("finished", _on_done)Explicit cleanup; the cost of not using bind_node.
Audit unbound tweens
If you create tweens without bind_node, every one is a candidate for leak. Audit; fix systematically.
“Tweens are independent of their callers' lifetimes. bind_node bridges that gap.”
Make bind_node the default in your project. Tween without binding is a code smell.