Now that bug 769273 has now landed in m-c, we should start using Cu.nukeSandox in order to kill all leaks on addon disabling.
Here is a pull request to start using it on CommonJS modules:
We may want to use it for content script sandboxes too.
Given pull request 479 and last try server build from gabor (bug 769273 comment 39)
And an awfull addons which desperatly want to leak by using such code:
require("window-utils").activeBrowserWindow.foo = this;
We end up leaking only cuddlefish and loader sandboxes instead of all 41 module sandboxes! We are leaking these two because we don't call nukeSandbox on them.
Commits pushed to master at https://github.com/mozilla/addon-sdk
Bug 775067: Start using Cu.nukeSandbox for CommonJS modules.
Merge pull request #479 from ochameau/leak/use-nukeSandbox
Bug 775067: Prevent leaking sandboxes by using Cu.nukeSandbox. r=@gozala
(In reply to Alexandre Poirot (:ochameau) from comment #1)
> We end up leaking only cuddlefish and loader sandboxes instead of all 41
> module sandboxes! We are leaking these two because we don't call nukeSandbox
> on them.
Hopefully bug 771409 will take care of that!