2 Replies Latest reply on Sep 21, 2010 2:29 PM by tehxike1

    Deconstructor

    tehxike1 Level 1

      Where's the best place to handle removing class event listeners?  partRemoved is great for cleaning up after partAdded...is there something comparable for an entire class?

        • 1. Re: Deconstructor
          Flex harUI Adobe Employee

          It is often wise to remove some listeners when REMOVED_FROM_STAGE, but there

          is no deconstructor or other code that runs just before an object gets GC'd.

          You have to decide what the likelihood that an object will be re-added to

          the stage and whether it is efficient to remove and re-add listeners that

          way.

           

          Sometimes we'll require that you call a release() or unload() API and

          sometimes we'll also use weak reference listeners.

          • 2. Re: Deconstructor
            tehxike1 Level 1

            Thanks.  I've seen removedFromStage used a fair amount, but wasn't sure if it was ideal or not.