Lifetimes is not too complicated in GDScript, it just depends of the type:
Object Must be freed manually by calling free.
Reference: Freed automatically when the reference count reaches 0.
Node:
Inside the scene tree: Freed automatically by the parent. Optionally with queue_free.
Not inside the scene tree (very rarely the case...): Same as Object. Must be freed manually by calling free.
https://github.com/godotengine/godot/issues/8985
댓글 없음:
댓글 쓰기