TThread.FreeOnTerminate
Indicates whether the thread should free itself when it stops executing.
Declaration
Source position: classesh.inc line 1984
public Property
FreeOnTerminate : Boolean;
Description
FreeOnTerminate, when set to True indicates that the tread instance will freed automatically as soon as the thread stops executing. You can use the OnTerminate property to get a notification of when the thread has terminated and will be freed.
When setting this property to True, in general you may not read or write any property of the TThread instance from a different thread, because there is no guarantee that the thread instance still exists in memory. This implies 2 things:
The OnTerminate event handler should be set before setting FreeOnTerminate to True The properties can still be read and set in the OnTerminate event handler, as the thread instance is then still guaranteed to exist.
See also
Name | Description |
---|---|
OnTerminate | Event called when the thread terminates. |