mozilla/addon-sdk — pull request #473 by ochameau (2012-06-27 18:28:31+00:00)
Title: Bug 764840: Fix loader.js JSM leak.

I sent an empty branch to previous PR #465 that closed it. So here is a new one.
You are right, we can make it way more simplier.
We can safely unload the JSM right after loading it.
It basically just remove one strong reference from the JSM cache to the JSM global object.
This reference prevent from collecting the whole JSM on addon disabling,
but doesn't force any other reference to be collected.
So that any existing reference to the JSM or any object from it would still work.