[Overview][Classes][Procedures and functions][Index] | Reference for unit 'AsyncProcess' (#lcl)

# TAsyncProcess.HandleProcessTermination

Performs actions needed when the process is terminated.

## Declaration

Source position: asyncprocess.pp line 44

`protected procedure TAsyncProcess.HandleProcessTermination(`
`AData: PtrInt;`
`AReason: TChildExitReason;`
`AInfo: dword`
`);`

## Arguments

`AData` |  | Data for the process notification.
`AReason` |  | Reason(s) for the process notification.
`AInfo` |  | Process exit code.

## Description

HandleProcessTermination is a procedure which performs actions needed when the process is terminated. HandleProcessTermination is assigned using AddProcessEventHandler when Execute is called.

HandleProcessTermination calls UnhookProcessHandle and UnhookPipeHandle to release the handlers in the class instance. HandleProcessTermination signals the OnTerminate event handler when it has been assigned.

## See also

TAsyncProcess.Execute |  | Executes the process.
TAsyncProcess.UnhookProcessHandle |  | Removes the process handler assigned for the process.
TAsyncProcess.UnhookPipeHandle |  | Removes the pipe handler assigned for the process.
TAsyncProcess.OnTerminate |  | Event handler signalled when the process is terminated.