Ron,

     Thank you. I hadn't pay attention to that code on AEVAL.

Atte.
  Vic

On Tue, 3 Feb 2009, Ron Pinkas wrote:

>>     But, what about the second part? Looks like the following code could
>> leave unreleased memory:
>>
>>     x := {}
>>     AEVAL( x, { || NIL } )
>>     AADD( x, DATE() )        // Dynamically created string...
>>     AADD( x, TIME() )        // Dynamically created string...
>>     AEVAL( x, { |x,i| IF( i == 2, ASIZE( x, i - 1 ), ) } )
>>               // Removes last item, but it't not cleared!
>>               // (Ok... it's wrong code, but...)
>>     x := NIL        // Only first item will be released...
>>
>> Will it happen?
>
> Unless I miss something, as is explained by the code, asize operations are
> simply DEFERRED in aEval(), which is a Clipper compatibility specification.
> I'm not aware of any problem of unreleased item.
>
>>>> When "( pBaseArray->uiFlags & 0xF000 )" is on, items deleted with
>>>> "ASIZE( aArray, LEN( aArray ) - 1 )" aren't cleared. Is it possible
>>>> any "complex" item would not be freed?
>
> No, look just below the eval loop:
>
>            pBaseArray->uiFlags = uiFlags;
>
>            if( pBaseArray->ulLen != ulLen )
>            {
>               ULONG ulNew = pBaseArray->ulLen;
>
>               pBaseArray->ulLen = ulLen;
>               hb_arraySize( pArray, ulNew );
>            }
>
> Ron

------------------------------------------------------------------------------
Create and Deploy Rich Internet Apps outside the browser with Adobe(R)AIR(TM)
software. With Adobe AIR, Ajax developers can use existing skills and code to
build responsive, highly engaging applications that combine the power of local
resources and data with the reach of the web. Download the Adobe AIR SDK and
Ajax docs to start building applications today-http://p.sf.net/sfu/adobe-com
_______________________________________________
xHarbour-developers mailing list
xHarbour-developers@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/xharbour-developers

Reply via email to