----- Original Message ----- 
From: "devenhariyani" <[EMAIL PROTECTED]>
To: <[email protected]>
Sent: Thursday, December 04, 2008 1:21 AM
Subject: [flexcoders] Error 1189: Attempt to delete the fixed property.


> 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.

The array isn't added dynamically - it's declared so you may not delete it.

The storage allocated for the array will be eligible for garbage collection 
(provided nothing else is referencing the array) when you leave the 
function - it's no longer in scope.

In other circumatsnces, you can make the array eligible for garbage 
collection by setting arr to null (provided nothing else is referencing the 
array).

Paul

>
> 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