As per title, if I launch a thread with Thread::launch() then I exit my application while the thread is still running, then it will leak.
I believe that a better behavior would be to call stopThread() on those LambdaThreads that are still alive when the application exists, to give them a chance to terminate cleanly and thus delete themselves (which AFAIK is a feature unique to them and the actual reason why I’m using them)
In order not to break the current behavior, the new functionality could be implemented adding another Thread::launch() method, whcih takes an additional int parameter which is the argument for the final stopThread() to be called at shutdown, i.e. the number of milliseconds to wait for the thread to exit before forcibly killing it.
The old Thread::launch() method would keep its current behavior, i.e. no stopThread() called at all.
What do you think?