I'm creating an action (using actions/javascript-actions) that creates something and then needs to clean up that something should someone cancel the job halfway.
I'm having trouble finding how to hook into pre-exit/cancel and do cleanup actions. Is this possible? Does anyone have any suggestions on achieving this?