On May 10, 2012, at 7:24 PM, Brandon Benvie wrote:

> Ahh yes I see. The circular reference case. Well, almost....

And that's not the only leak.  You create a new valueOf method for each 
WeakDictionary a given object is used to key.   These methods are threaded off 
of the key object starting with the most recently created one and each valueOf 
indirectly captures the value associated with that object key in the 
corresponding WeakDictionary.  If there are no reference to a WeakDictionary it 
will get garbage collected.  However, the corresponding valueOf method for each 
object that was used as a key for that WeakDictionary will stay behind.  So 
will the value that was associated with that key in the dictionary.

This isn't a bad solution if you know need a weak keyed map where you know that 
each object is only going to key a single such map 
_______________________________________________
es-discuss mailing list
[email protected]
https://mail.mozilla.org/listinfo/es-discuss

Reply via email to