Dafür gibt es schon eine extra Methode
nämlich
Thread.Free;
- ja, so einfach
Seit ich diesen Hinweis gelesen habe bin ich kein Freund von TThread.Free mehr:
Zitat:
NEVER call Free() on a thread that has not been signaled to terminate yet. DO NOT rely on the thread destructor calling Terminate() and WaitFor() for you. ALWAYS call them explicitally in your own code instead. Plenty of people have run into problems over the years by freeing a running thread and letting the destructor do the termination. It just does not work correctly, and is not the right place to
handle this anyway. – Remy Lebeau