Does Unreal detroy childrens upon parent destruction ?
I'm still working on memory management for our game and I wonder something.
Does Unreal is supposed to destroy automatically`UPROPERTY()`marked childrens objects (Actor or Object) pointers upon their destruction ?
Consider the folowing code :
This code would be the same for a UObject derived object.
For this case, assume that I no (0) instance of the DummyActor and I have a button to spawn an instance and another to destroy that very same instance. Also, assume that the texture is not referenced anywhere else.
When I call delete upon the button, is it supposed to also destroy the texture pointer and release the memory associated with the texture ?
If YES, that doesn't work at all.
If NO, should I declare a ClearChildrens function that will manually delet every childrens data ? or what sould I do ?
I mean in raw C++ there's no garbage, so I'm well used to clean childrens memory upon destructor call.
But with Unreal, we are supposed to have a garbage collector that is supposed to clean unused memory right ?
Or am I crazy and missed something o0 ?
Thanks for any help..
Follow this question
Once you sign in you will be able to subscribe for any updates here