Einzelnen Beitrag anzeigen

mjustin

Registriert seit: 14. Apr 2008
3.005 Beiträge
 
Delphi 2009 Professional
 
#13

AW: TThread gibt beim Beenden Speicherleck

  Alt 2. Mär 2019, 19:03
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
Michael Justin
  Mit Zitat antworten Zitat