I have a method (UFUNCTION) that creates a local TArray<APawn>*, pouplates it with some pawns, and returns this list to the BP caller. In the BP code I then iterate over all items returned and do some stuff. Now, a question for better understanding: Since that TArray has been defined locally in the method, from my C++ understanding it should be destroyed as soon as the method returns. Which does not seem to be happening, since I can use that array in BP after the method call.
What am I missing here?
Do I need to manually destroy the the array object somehow?