I’m having a problem with a TArray of scene components getting wiped out after I remove an item from it.
UPROPERTY() TArray <UMyComponent *> Components;
If I call:
Everything gets messed up, pointers in the UMyComponent class get set to 0xddddddddddddd, etc. The members of the list still have the correct pointers but the objects they point to seem to be destroyed. But not immediately.
I’ve stepped over the removal process above and it’s fine for quite a while afterwards, so then I hit continue and the list is corrupted then. So I suspect garbage collection.
Is there anything else I might be missing that could be causing this?