Hi Deven,

I'll take a stab at this, but I know that Gordon will correct me if I'm
wrong.  :)  Just set the array to null or [] at the end of the function.
It should get GC'd then, because of it's scope.  If I remember
correctly, delete shouldn't be used for Objects.

-TH

--- In [email protected], "devenhariyani" <[EMAIL PROTECTED]>
wrote:
>
> hello,
>
> I'm having some very confusing problems with memory leaks. in one
> particular function, I dynamically create a new Array(), and when i
> try to delete it I get a compile time error. a simplified version of
> the function looks like:
>
> public static function doSomething():void {
> var arr:Array = new Array();
>
> //do somestuff with the array
>
> delete(arr);
> }
>
> When compiling I get the error:
>
> Error 1189: Attempt to delete the fixed property arr. Only
> dynamically defined properties can be deleted.
>
> In a different situation, I also get similar problems. For example,
> when I have a private property that is part of my Application class i
> assign dynamic data to it during the life of the app, but i cannot
> delete it.
>
> --Deven
>



Reply via email to