Hello everybody.

I have a question (maybe stupid) about dynamic arrays...

Usually, before to close the application, to avoid memory leak, i do :

  if length(MyArray) > 0 then
 for x := 0 to high(MyArray) do
 MyArray[x].Free;

But, if i use : 

 setlength(MyArray, 0) ;

would it do the same job ?

Thanks.

Fred
                                          
_______________________________________________
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal

Reply via email to