T-Res interface: when a task is deleted, free its processing function memory and clear its state.

As in title