When does CanvasDestroyed event fire?

When is the Grasshopper.Instances.CanvasDestroyed event firing?
I can subscribe to the CanvasCreated event successfully and run code before Grasshopper is fully up and running but when I subscribe to the CanvasDestroyed event I never see anything from it. I have some clean-up code I want to run as Grasshopper is closed, is this possible somehow?

Best Morten