Registers a termination hook that will be executed when the Task is killed.
delegate to be called after the task terminates
See Implementation
Registers a termination hook that will be executed when the Task is killed.