[fpc-pascal] reference counting of multi-dimensional array

Jonas Maebe jonas.maebe at elis.ugent.be
Fri Mar 28 09:47:01 CET 2014


On 28/03/14 02:50, Xiangrong Fang wrote:
> var
>    a2: array of array of Integer;
>    i, j: Integer;
> begin
>    SetLength(a2, 3);
>    for i := 0 to 2 do begin
>      SetLength(a[i], 3);
>      for j := 0 to 2 do a[i][j] := 1;
>    end;
>    a2 := nil; <-- will this free all memory of a[0]...a[2]?
> end;

Yes.


Jonas



More information about the fpc-pascal mailing list