Is there a good spot to put any clean-up code, where it will be run after each time my plugin is run?
Right now, I have a class set up in StartupPlugin and cleaned up in ShutdownPlugin. But that means that the setup code gets run when Illustrator starts, and doesn't get cleaned up until Illustrator quits.
What I'm looking for is the spot that will get run on each "activation" of my plugin, and then cleaned up after all notifications and messages have finished. There must be somewhere like that that I'm missing?
I could take a look, but we just prevent our plugin from being unloaded, and then do what you're doing.