Revision history [back]
You can write an extension script as described in https://wingware.com/doc/scripting and connect to a signal that is emitted when Wing quits. This isn't currently exposed in the API (I'll see if we can add this, and thus am marking this ticket as a feature-request) but you can reach through the API to do it, something like this:
import wingapi
def _quitting():
# Do something here
pass
wingapi.gApplication.fSingletons.fGuiMgr.connect('about-to-quit', _quitting)
There is also a signal called 'quit' that can be used instead. The one above is emitted when the mainloop is still running while 'quit' is emitted after the mainloop exits. In your case either is probably fine.