FRunnableThread naming

I created a network listener thread, based off the FRunnable class, that runs on an Actor and fires when BeginPlay() is called. Running the project from the editor seems to work fine. However, when I start the module for a second time without closing the editor in-between, I get the following warning

LogStats:Warning: MetaData mismatch. Did you assign a stat to two groups? New //STATGROUP_Threads//TestThread///Thread_484c_0///////STATCAT_Advanced//// old //STATGROUP_Threads//TestThread///Thread_4fc4_0///////STATCAT_Advanced////

Where TestThread is the name of the thread passed to FRunnableThread::Create (i.e. FRunnableThread::Create(TestThread, TEXT(“TestThread”), 0, TPri_Normal);).

As far as I can see, the thread is fully terminated after terminating play and the FRunnableThread object as well as the FRunnable object are both correctly deleted. It seems like the name of the thread lingers somewhere, but I can’t seem to find out where. The thread also does not show up in the ThreadRegistry anymore after deleting the objects (it does show up during play). Should the thread be named differently each time it is launched? I did not see anything like this in the examples I could find (nor in the UE4 source).

I’ve had this issue as well, I chose to use a static int32 incrementer and append the integer to the end of the name so each instance of the thread was uniquely named.

I’d be curious to know from Epic if there is a different and preferred workflow!

:slight_smile:

Rama

This is what I did as well, but it feels a little like a hack. It would indeed be good to hear if this is the preferred solution.

Can you explain this process in a little more detail please? i am having an issue with metadata mismatch.
thanks.

Can you explain this process in a little more detail please?

Agree