Cameron McCormack wrote:
My implementation of animation is (slowly) progressing. I noticed just now a bug in my program where some elements were forgetting their animated attribute values. I see that dom.svg.AbstractElement is using a SoftDoublyIndexedTable to store the (namespace, localName, LiveAttributeValue) triples.
When you call SVGOMElement.getAnimatedLengthAttribute it creates a new SVGOMAnimatedLength and stores it in the table if there wasn't one there already. It doesn't keep a reference to this value around, though, and so I guess the garbage collector cleans it up later on because the SoftDoublyIndexedTable doesn't keep a hard reference to it.
I suggest changing AbstractElement to use DoublyIndexedTable. I don't see any obvious memory leak issues there, but maybe there are some that prompted the use of the soft references in the first place.
I think this is safe, it probably used a soft reference just so the live attribute would be GC'ed - since it did not use to hold any 'useful' information, it just provided a different interface to the DOM attribute. I'll try and look at it a little closer later on.
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]