mootools/mootools-core — pull request #2376 by MArcJ (2012-06-30 02:41:27+00:00)
Title: Fix for memory leak in Element.addEvent and Element.store.

Since Element.retrieve saves the values into the global var `storage`, the references won't be removed when the Element itself has been destroyed from the garbage collector.
A bit more special with Element.addEvent: this saves `this` to the global var `collected` with no further usage. The bad side effect of this is, that `collected` holds a reference to the whole Element and can't therefore be destroyed from garbage collector.

Even while Element.destroy() clears this global vars a bit, it would be much nicer, if the garbage collector itself find and kills those unused references.

I've removed both global vars and therefore also the function clean(). Now, the garbage collector can work as it should.