Garbage collection and stack scan

Does the garbage collector in Unreal scan the stack for UObject references? Can a UObject be guaranteed to live while it’s on the stack, even if it’s not part of the tree?

1 Like

How would you even properly construct a UObject on the stack in the first place? NewObject(), ConstructObject() etc. always create an instance on the heap.

I meant scanning the stack for references to UObjects. Normally garbage collection involves scanning the stack for still live references outside roots