1 Reply Latest reply on Oct 2, 2009 11:55 PM by sri harsha namala



      Ok, I have a question mark existing in my brain so long.


      "Do we need to use 'delete' command to delete something if we create something before like new XXX ?"


            in this case, I have a function that will be called several times

            in the function, i need to empty all element of three array. So

            I think the easy way is just to  create new one. The thing is

            'should I delete the previous array memory?" or the garbage collection can handle the memory thing.

             timeData = new Array();
             distanceData = new Array();
             timeData = new Array();




           thanks for your contribution.

        • 1. Re: 'Delete'
          sri harsha namala Level 2


                 Make the object to null when you feel that the use with that object has been finished.

                         timeData = null;

                 When object is null it will be cleaned by Garbage Collector.