Is there a way to terminate a process if a user closes the browser tab/window?

In our case management system, we have a process which - 

  • Is run as a quick task
  • Every UI node in the process has an exception timer
  • When a user launches an action related to a case, the case gets 'locked' to the process initiator and no other user can edit the same case if it is being edited by another user

However, we have users who repeatedly end up using the browser tab/window close functions if they want to 'x' out of the task they are in. The process continues to run in the background until the timeout is hit and other users who might need to make edits are locked out of the system until the previous process times out. Is there a solution/what are my options to terminate a process if a user closes the browser window? 

  Discussion posts and replies are publicly visible