![]() |
Attention | Topic was automatically imported from the old Question2Answer platform. |
![]() |
Asked By | AdamActual |
Hi all,
Sorry for the basic question. I have some data classes that inherit from Object, are created at the beginning of the game and never destroyed.
The documentation says that Object.free()
should be called for Objects to avoid memory leaks. Am I correct in believing this isn’t necessary if the Object is never actually removed?
Basically, does the application automatically delete everything when it’s closed? Or do I need to call Object.free()
somewhere (such as _on_exit_tree
) to ensure the application doesn’t leave anything around?
Thanks!
Very good Question dude, hope you get it answered.
Godot boasts about its garbage collection and recommends using Reference (Think its called something else in Godot4) instead.
For me personally can’t get the C way of having to do everything yourself out of my system and always do
func foo():
var array = Array()
#
# use array here
#
array = null
return
Wakatta | 2022-11-07 16:46