In this lecture, we reassigned the RootComponent pointer to our new UCapsuleComponent object, but we didn’t call a destructor or free any memory on the initial RootComponent. Does that mean it’s NULL by default, or is there some C++ magic going on behind the scenes to handle destruction and memory deallocation?
Yes.
Also all UObject’s are garbage collected using Unreal’s custom system
Unreal Object Handling in Unreal Engine | Unreal Engine 5.3 Documentation
1 Like