estanglerbm opened a new pull request #1030:
URL: https://github.com/apache/royale-asjs/pull/1030


   Add method finalizeThis() to IViewCursor, and fix memory leak in MX ADG due 
to event listener leak, due to lack of weak references in JS.
   
   In Flex, these cursors had addEventListener() with the 5th arg = true for a 
weak reference (because, in MX ADG, the cursor listens to its view, which then 
gets a reference to the cursor, and the view is longer-lived).  In JS, the 
reference is no longer weak, and the event listener references (to the cursors) 
are being kept around as the item renderers are removed and recreated on 
dataProviderChange events.  This adds up to a significant memory leak over time 
and excessive listeners.
   
   I don't know what the general strategy is for calling removeEventListener() 
on such items, so I added finalizeThis() to the interface (MX IViewCursor) and 
made sure, at least for MX ADG, that it is called during destruction of each 
cursor.
   
   (There are other event listener leaks going on in MX ADG.  This was the 
biggest one.)


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to