Is a freed Object ever truly free?

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By wetbadger

If you attempt to call a function on a previously freed Object you get something like this as an error:

Attempt to call function 'get_collision_point' in base 'previously freed instance' on a null instance.

If the instance no longer exists in memory, it seems they are replaced by “new” instances of something akin to a “record” of previously freed nodes.

This is great for debugging, but what if I want to remove something from memory, and all records that it ever existed? What’s wrong with a good old segmentation fault? Otherwise, some projects will be forced to leak some memory in the engine.

Are these Objects truly free when the executable runs?

:bust_in_silhouette: Reply From: Inces

Nodes are entirely freed. Only references to them, before becoming null, are replaced into this specific value type of “freed node”. This doesn’t use any significant amount of memory, You can think of it as a “metadata of null”. All properties of object, as well as RID, are gone.
I don’t think it is possible to design a freeing system, that automatically removes all hard references thruoghout whole code.