How to detect user abort

I want save some flags when a user abort my actor.
Is there any way I can detect if the actor aborted.
Run a script when abort happen via event or any other mechanism ?
Thanks
Was this page helpful?