Multi-Threading, Not Killing When jumping out of play mode

Hi,

So I have a worker thread that has a while loop in it’s Run method and it prints out a string after 1 sec sleep and once it has printed out 10 times it kills the thread.

now if I press escape and jump out of play mode the thread keeps on running in the background, I have an Actor that manages the threads, I have tried to kill the thread on it’s destructor and it works but there is no way of knowing if the thread object still exists or like if the thread was already killed the destructor will try to kill the thread again resulting in a crash. (WorkerThread != nullptr) is always true.

I suppose without some example source code noone jell help.

So I ask: Why do you don’t use standard functionalities like Timers, EQS etc. ?

well i am doing this because the end goal is to get the data from database without pausing the main thread.

I will post the code, I am trying out a new way of implementing Async tasks via threadpool that auto deletes it after completion.

This sounds like a good use for a Subsystem.