Correct way to create a TArray shared pointer in C++? (ESPMode::ThreadSafe)

I’m trying to create a smart pointer to an array to use in a thread.

I declared it like this

TSharedPtr<TArray<FMySessionSearchResult>, ESPMode::ThreadSafe> out;

I instantiated it like this:

out = MakeShared<TArray<FMySessionSearchResult>, ESPMode::ThreadSafe>();

However from time to time I get EXCEPTION_ACCESS_VIOLATION

So I think that it is not the correct way to create a smart pointer of an array.

I’m looking for an example.

Thank you so much!!

this way seems to work better (for now)

class SessionFound : public TArray<//FMySessionSearchResult>{};

TSharedPtr<SessionFound, ESPMode::ThreadSafe> out;

out = MakeShareable( new SessionFound() );