System.Classes.TThread.OnTerminate

From RAD Studio API Documentation
Jump to: navigation, search

Delphi

property OnTerminate: TNotifyEvent read FOnTerminate write FOnTerminate;

C++

__property TNotifyEvent OnTerminate = {read=FOnTerminate, write=FOnTerminate};

Properties

Type Visibility Source Unit Parent
event public
System.Classes.pas
System.Classes.hpp
System.Classes TThread

Description

Occurs after the thread's Execute method has returned and before the thread is destroyed.

Write an OnTerminate event handler to execute code after the thread finishes executing.

Note: The method assigned to the OnTerminate event is executed in the context of the main thread rather than the context of the thread being terminated. This means you can access the user interface of your application safely without calling the Synchronize method.

OnTerminate is an event handler of type System.Classes.TNotifyEvent.

See Also

Code Examples