If you use the Exit menu to quit Messenger, every nsIAppShellComponent's Shutdown gets called twice. This is because the implementation of Exit and main call nsAppShellService::Shutdown. What ends up happening is that the component gets destroyed the first time and then gets recreated and destroyed again the second time. It seems wasteful if it can be avoided. I've cc'd Steve and Paul because right now it looks like the XUL Overlay version of Exit calls EditShell::Exit. It seems stranger to be using the Editor's implementation of Exit to shutdown Messenger, for example (even if at the moment they would do the same thing). I wonder if we need some other version of Exit?
cc'ing Simon. Simon, please work with Paul, Don, Scott to make this right. Is this a mail-specific problem, or do we have the same problem in ender itself?
Bill Law is working on the exit process, so should probably figure out what the best thing is here.
This is not just a Messenger problem. It's everywhere. I just used Messenger as an example because that's what I was testing. I tried it from the Editor and the components get Shutdown twice. I cc'd the editor team because I noticed that your version of Exit is getting used. I just didn't think that seemed correct.
Bill, how bad is this really?
Reassigning to me since I am working on shutdown. This will be real easy to fix.
Fix checked in. Broke shutdown into the Quit ui command and the shutdown cleanup function. All quiting ( from the UI ) should use the command in globalOverlay.js
Can't verify this (developer issue); taking davidm's word for it and marking it verified.