See all glossary termsIn OOP parlance, the term "lifecycle" refers to the logic governing creation, lifetime, and destruction of an object.
For example, when opening a file, GDScript needs to:
- Get a handle to the file
- Read the file and store the results somewhere in memory
- Close the file
- Release the memory
Often, in GDScript, we talk of "lifecycle" when discussing the order in which functions are called during the node lifecycle. For example, when a node is added to the scene tree, the _enter_tree()
function is called. When the node is removed from the scene tree, the _exit_tree()
function is called. Other objects rarely have a lifecycle per se, even if all objects have at least the _init() function.See Also
Related terms in the Glossary
school.gdquest.com - 0.3.5-2024-12-12T18:17:18.104Z-a38dc74be3238fd1ea161f4df67b95520741da9d-release