I asked the question for a string array. I see that we can assign a
string directly to a pchar, but when I SetLength() such an array, do I
have to free the PChar string no more used or is it done
automatically?

var
 a: array of PChar;
begin
 SetLength(a, 4);
 a[0] := 'First pchar line';
 a[1] := 'Second pchar line';
 a[2] := 'Third pchar line';
 a[3] := 'Fourth pchar line';
 SetLength(a,2);
 a[0] := 'Yet another pchar line';
 a[1] := 'At last, a pchar line to finish';
end;

Is the following causing a memory leak? Do I have to SetLength(a, 0)
when I'm completely done with 'a' or is it done automatically?

--
Alexandre Leclerc

_________________________________________________________________
    To unsubscribe: mail [EMAIL PROTECTED] with
               "unsubscribe" as the Subject
  archives at http://www.lazarus.freepascal.org/mailarchives

Reply via email to