I am new to this and a bit at a loss about the exact way the garbage collection works for restartless addons.
From my shutdown function I currently call all objects I have to do cleanup. They remove any event handlers to outside code they might have set and then delete all properties on themselves.
Then I call delete namespace.ObjectA
for all objects on there. The namespace itself is a variable I created in bootstrap.js. I'm wondering if this is necessary, or will firefox after calling the shutdown function of my addon remove all global variables from bootstrap.js and thus with that all other objects that aren't reachable from outside my addon?
Obviously if the reason for shutdown is Firefox application shutdown, I don't do any cleanup.
Am I missing anything I should do on cleanup?
Please note that restartless addon must do these on 'disable' or 'uninstall'.
The addon must remove event listeners & observers.
It is not important (and not done) to delete namespace which is a variable and will be done by GC.
Furthermore, addon must revert (not reset) any changed preferences outside its own.
As you have said, there is usually no need for any action on Firefox application shutdown.
References: