So are you saying that, in general, anonymous functions should not be used as
listeners?

If its anything like in Java, (once the calling method returned) the
anonymous function would only be referenced by the event dispatcher and so
(assuming weak references are not used) would only be garbage collected when
the event dispatcher is garbage collected. At least, that's how I understand
it.

I posted a question about this a few weeks ago, but didn't get a reply.


Amy-28 wrote:
> 
> My understanding is that anonymous functions _cannot_ get garbage 
> collected unless you use weak references when you add them.  Which 
> means there's a really good chance they'll get garbage collected 
> before they get called.
> 

-- 
View this message in context: 
http://www.nabble.com/Best-practice-for-calling-asynchronous-functions--tp20930596p20976648.html
Sent from the FlexCoders mailing list archive at Nabble.com.

Reply via email to