When the user clicks the system-provided close button in a toplevel window, I need to free resources.
The question: how do I intercept this event, so that I can call some of my own code?
I've looked through the docs, but can't find anything about destroying toplevel windows.