TSubstringList.Destroy Destructor

destructor Destroy; override;

Frees the list's rows, and the items' objects when OwnsObjects is True.

Result: stored in self (calling object)

Examples

Free gives every item's memory back.

uses Substr;

procedure Example;
var List: TSubstringList;
    Live: NativeInt;
begin
    List := TSubstringList.Create(2);
    Live := Substring.ThreadStats.LiveBlocks;
    List.Add(Substring.Create('x', 600));
    Assert(Substring.ThreadStats.LiveBlocks = Live + 1);
    List.Free;
    Assert(Substring.ThreadStats.LiveBlocks = Live);
end;
See Also: TSubstringList.Clear, TSubstringList.OwnsObjects