title: Execute command when UI window is closed | Maya/Python
body: <p>Here’s one I’m hoping should be quite simple:</p>
  <p>How can I get my UI window to execute a command when the user closes the window?
  I’ve created a scriptJob that runs while the window is open and I’d like to run a command to terminate it when the window is closed, and avoid having any scriptJobs running when the tool isn’t in use.</p>
  <p>Using Python in Maya2020
  Any pointers greatly appreciated</p>