How is the flag 'bAutoDeleteRunnable' and 'bAutoDeleteSelf' in FRunnableThread::Create(...) used?

Hey there,

I am currently struggling with a FRunnable I created…
I set up a custom FMessageHandler inheriting FRunnable to read messages coming in via tcp. This works quite well, but I want this thing to clear its local ‘Instance’ field when the client disconnects (which I currently determine via ping’ing it from Server->Client).

This is my create call:
Thread = FRunnableThread::Create(this, TEXT(“FMessageListener”), true, true, 0, TPri_BelowNormal);

To get the messages inside my managing class, I bound a local method which gets called when a message arrived.
If the message is “DISCONNECT” I set the IsActive flag to false which in turn should the Run-method inside the Thread cause to quit. After that I thought the Thread somehow knows its “done” now and will auto-delete itself. But it wont…

Any information on this? When is this auto-deletion happening? Do I get this wrong?
If thats not the way to use this, then how can I delete my Instance, so that another connecting client can get its “own” instance for communication?

Thanks in advance…

Tim

EDIT:
I just saw, that:
"‘FRunnableThread::Create’: Function deprecated. Use FRunnableThread::Create without bAutoDeleteSelf and bAutoDeleteRunnable params and delete thread and runnable manually. "

It looks like I found a possible answer for this myself! After finding out, that bAutoDeleteSelf and bAutoDeleteRunnable are deprecated. I switched to a “lazy”, but manually deletion of Thread and Runnable-Instance. Now these are deleted when a new client wants to connect and NOT at the end of processing a client!

UE_LOG(AliceRT, Warning, TEXT("Client wants to connect. "));
if (!FMessageHandler::Instance) // no instance yet? create one
{
            ...
	FMessageHandler::CreateInstance(Socket);
            ...
	return true;
}
    // instance available but inaktive? delete old one and create new
else if (FMessageHandler::Instance && !FMessageHandler::Instance->IsActive)
{
	delete FMessageHandler::Instance->Thread;
	FMessageHandler::Instance->Thread = nullptr;
	delete FMessageHandler::Instance;
	FMessageHandler::Instance = nullptr;

            ...
	FMessageHandler::CreateInstance(Socket);
            ...
	return true;
}

This works fine now!