1 Reply Latest reply on Feb 22, 2012 10:29 AM by drkstr_1

    Proper way of removing views

    Zolotoj Level 3

      I have a VGroup with views added to it dynamically:


      At some point I removing a child:



      Is that correct way of removing a screen? Is there any cleanup involved?



        • 1. Re: Proper way of removing views
          drkstr_1 Level 4

          As long as there are no references to your view, it should garbage collect just fine.


          A few trouble spots:


          1. Binding something to your view on a signleton controller (or one who's instance exists outside the component scope), without using weak listeners.


          2. Regestering an event listener outside your component, with a reference to a function inside your component


          3. Forgetting to null out any references to that view you may have created