title: Running a cleanup after a program crashes
body: <p>I'm currently writing quite a simple app, but it makes a change to the OS which gets changed back when the program is closed.</p>
  
  <p>The worry of course, is if the program crashes.  I can do everything in my power to prevent it from crashing, or handling things if it does crash - but I can't stop someone from force closing the process (unless I can?)</p>
  
  <p>Is there a way to catch that event and run just a very quick cleanup before the process exits?</p>