1 Reply Latest reply on Oct 2, 2008 7:08 AM by Newsgroup_User

    Weak referenes

    stigbn Level 1
      Hi all

      Are there any disadvantages with using weak references for eventlisteners ?
      That is, instead of doing this:


      I would do this:


      I know that I should ensure to unsubscribe all events, but using weakrefs would help garbage collection in case that I forget to unsubscribe some event handler.

      My question is:

      Does using weak references like this impose any performance overhead or other disadvantages ?

      And by the way, when adding event listeners in mxml code of a Flex app, are weak references then used ?

      Best regards S.Schmidt