Was weak-reference listeners for binding introduced in beta3 or an earlier beta?

On 24/01/2008, at 6:08 PM, Alex Harui wrote:


Pretty sure we fixed this in 3.0. Weak-reference listeners are used in Binding.



You usually do not need to remove inline event listeners as the point back from the child to the document and therefore cannot cause a leak.



From: [email protected] [mailto:[EMAIL PROTECTED] On Behalf Of Bjorn Schultheiss
Sent: Wednesday, January 23, 2008 10:38 PM
To: [email protected]
Subject: [flexcoders] destructing objects / memory management best practices



So do we need to manually unwatch each binding statement ?



Also what about inline event listeners in mxml ?

Since we cannot manually remove them do i also need to switch to declaring all event listeners in AS ?



This is currently a major issue for me as in our latest Dev we are using modules and loading/unloading/reloading are very important issues to us.









On 24/01/2008, at 7:30 AM, Jerome Clarke wrote:




This is the reason why I only used Actionscript based binding instead of MXML... simply because you have control of that

On Jan 23, 2008 6:11 PM, Samuel R. Neff < [EMAIL PROTECTED]> wrote:



So is it correct then that if you bind to something outside, say like to a singl! eton Mod el, then that binding creates a link which the author has no control over and can not destroy. So lets I have an example like:

<Canvas title="{Model.instance.applicationTitle}" />

Then that simple binding will cause every instance of this component to be created and never GC'd? We as Flex developers have no official way to tell this MXML based binding to unwatch and thus no way to clear the strong reference from the singleton Model to the component. Isn't this a huge memory leak? I don't understand how to reconcile this with your recommendation of being wary of reading outside to other parts of the app. Are you saying we should not use MXML based bindings to reach outside our component at all?

Thanks,

Sam



--------------------------------! -----------
We're Hiring! Seeking a passionate developer to join our team building Flex based products. Position is in the Washington D.C. metro area. If interested contact [EMAIL PROTECTED]






From: [email protected] [mailto:[EMAIL PROTECTED] On Behalf Of Matt Chotin

Sent:< /b> Wednesday, January 23, 2008 12:41 PM


To: [email protected]
Subject: RE: [flexcoders] destructing objects / memory management best practices



No, you're right that binding does not use weak listeners (we tried at the end of Flex 2 development and found some really bad bugs if we did that). So I shouldn't be making a global statement about don't check bindings. But I guess my point is not that not all bindings are bad, especially when done within a single MXML document that doesn't try to reach outside. Best practice is to be wary of how easily you reach out into other parts of the! app. The more you can centralize that kind of thing, the easier it is to have code that releases listeners, references, etc.



From: [email protected] [mailto:[EMAIL PROTECTED] On Behalf Of Samuel R. N! eff
Sent: We dnesday, January 23, 2008 9:25 AM
To: [email protected]
Subject: RE: [flexcoders] destructing objects / memory management best practices



Matt,



My understanding from reading the binding code is that bindings do not use a weak reference when they add an event listener, so bindings must be cleared (unwatched) in order for an object to be available for GC? Are bindings created through MXML automatically unwatched at any point? Or am I wrong about bindings using a strong reference?



Thanks,



Sam



-------------------------------------------
We're Hiring! Seeking a passionate developer to join our team building Flex based products. Position is in the Washington D.C. metro area. If interested [EMAIL PROTECTED]











Reply via email to