For me, the question is: If I use someObj in the same way as my example above
(i.e. assigning it to a local variable), when will someObj get garbage
collected?

Is it (potentially) when the result/fault event is dispatched or could it be
earlier?


Alex Harui wrote:
> 
> I think Amy's point is that, w/o a reference to the anonfun, you can't
> call removeEventListener on it.  If I do:
> 
> someObj.addEventListener("foo", function (e:Event) { ... } );
> 
> someObj will release the anonfun when it gets garbage collected.  However,
> until that time, all objects in the scope chain won't be collectable.  I
> don't know if that's the case in Java.
> 

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

Reply via email to