/Engine/Source/Runtime/MessagingCommon/Public/MessageEndpoint.h
When an object that owns a message endpoint receiving on AnyThread is being destroyed, it is possible that the endpoint can outlive the object for a brief period of time if the Messaging system is dispatching messages to it. This helper function is to block the calling thread while any messages are being dispatched, so that the endpoint does not invoke any message handlers after the object has been destroyed.
static void SafeRelease ( [TSharedPtr](API\Runtime\Core\Templates\TSharedPtr)< [FMessageEndpoint](API\Runtime\MessagingCommon\FMessageEndpoint), ESPMode::ThreadSafe > & Endpoint )