Attention | Topic was automatically imported from the old Question2Answer platform. | |
Asked By | Charles Woodhill | |
Old Version | Published before Godot 3 was released. |
Hi again
Why are nodes/object not implement/inherit from reference?
i think there is a reason for that…
ive noticed when nodes removed from tree/parent then they not destructed,
which is ok i expect that.
but why they no reference?
for example, i dynamically build a gui control at runtime, with rows.
each row has n controls.
so now i have to keep an array (or similar) to store the controls (for later destruction)
wouldnt references make this much more simpler?
or have i missed something?
p.s. i come from c# where everything is a reference
EDIT: ok i could loop over childs and free all, maybe bad example, but question still vaid
greets & tnx
You don’t need to manually free all the children if you free their parent, because then children are automatically freed as well.
raymoo | 2017-03-16 17:08