Re: Auto cleanup of dynamic array of Trecord.DynamicArray when first is nilled ?
- From: Jamie <jamie_ka1lpa_not_valid_after_ka1lpa_@xxxxxxxxxxx>
- Date: Mon, 26 May 2008 12:14:42 -0400
Skybuck Flying wrote:
Hello,Dynamic Arrays use the same handler as the strings do.
Are dynamic arrays in dynamic array of records automatically cleaned up when dynamic array of records is nilled ?
program Project1;
{$APPTYPE CONSOLE}
uses
SysUtils;
type
Ttest = record
mCode : array of byte;
end;
var
vArray : array of Ttest;
begin
try
SetLength( vArray, 10 );
SetLength( vArray[5].mCode, 5*1024*1024 );
vArray[5].mCode[0] := 6;
readln;
writeln( vArray[5].mCode[0] );
vArray := nil; // auto clean up of code ?
readln;
except
on E:Exception do
Writeln(E.Classname, ': ', E.Message);
end;
readln;
end.
It seems like mCode array is automatically cleaned up ?
Bye,
Skybuck.
when you exit the block that declared it, code in the background
is generated to properly clean it up.
It should work fine unless there is something strange you're doing.
http://webpages.charter.net/jamie_5"
.
- References:
- Auto cleanup of dynamic array of Trecord.DynamicArray when first is nilled ?
- From: Skybuck Flying
- Auto cleanup of dynamic array of Trecord.DynamicArray when first is nilled ?
- Prev by Date: Re: Auto cleanup of dynamic array of Trecord.DynamicArray when first is nilled ?
- Next by Date: Re: Auto cleanup of dynamic array of Trecord.DynamicArray when first is nilled ?
- Previous by thread: Re: Auto cleanup of dynamic array of Trecord.DynamicArray when first is nilled ?
- Index(es):