Ignore:
Timestamp:
Apr 9, 2009, 11:04:41 AM (16 years ago)
Author:
george
Message:
  • Opraveno: Chyby v uvolňování paměti.
  • Opraveno: Program po rozdělení do více souborů opět funguje jako dříve.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/DelphiToC/UPascalSource.pas

    r13 r14  
    2424  TVariableList = class;
    2525  TFunctionList = class;
     26  TExpressionList = class;
    2627  TExpression = class;
    2728  TOperationList = class;
     
    5657    Parent: TCommonBlock;
    5758    function Search(Name: string): TType;
     59    destructor Destroy; override;
    5860  end;
    5961
     
    6769    Parent: TCommonBlock;
    6870    function Search(Name: string): TConstant;
     71    destructor Destroy; override;
    6972  end;
    7073
     
    7881    Parent: TCommonBlock;
    7982    function Search(Name: string): TVariable;
     83    destructor Destroy; override;
    8084  end;
    8185
     
    8690    Value: TValue;
    8791    OperatorName: string;
    88     SubItems: TList; // TList<TExpression>
     92    SubItems: TExpressionList;
    8993    Associated: Boolean;
    9094    constructor Create;
    9195    destructor Destroy; override;
    9296  end;
     97
     98  TExpressionList = class(TList)
     99    destructor Destroy; override;
     100  end;
     101
    93102
    94103  TOperation = class
     
    177186  for I := 0 to Modules.Count - 1 do
    178187    TModule(Modules[I]).Free;
     188  Modules.Free;
    179189  Device.Free;
    180190end;
     
    184194
    185195{ TConstantList }
     196
     197destructor TConstantList.Destroy;
     198var
     199  I: Integer;
     200begin
     201  for I := 0 to Count - 1 do
     202    TConstant(Items[I]).Free;
     203  inherited;
     204end;
    186205
    187206function TConstantList.Search(Name: string): TConstant;
     
    257276{ TTypeList }
    258277
     278destructor TTypeList.Destroy;
     279var
     280  I: Integer;
     281begin
     282  for I := 0 to Count - 1 do
     283    TType(Items[I]).Free;
     284  inherited;
     285end;
     286
    259287function TTypeList.Search(Name: string): TType;
    260288var
     
    273301{ TVariableList }
    274302
     303destructor TVariableList.Destroy;
     304var
     305  I: Integer;
     306begin
     307  for I := 0 to Count - 1 do
     308    TVariable(Items[I]).Free;
     309  inherited;
     310end;
     311
    275312function TVariableList.Search(Name: string): TVariable;
    276313var
     
    312349constructor TExpression.Create;
    313350begin
    314   SubItems := TList.Create;
     351  SubItems := TExpressionList.Create;
    315352  SubItems.Count := 2;
    316353end;
     
    318355destructor TExpression.Destroy;
    319356begin
    320   SubItems.Destroy;
     357  SubItems.Free;
    321358  inherited;
    322359end;
     
    341378end;
    342379
     380{ TExpressionList }
     381
     382destructor TExpressionList.Destroy;
     383var
     384  I: Integer;
     385begin
     386  for I := 0 to Count - 1 do
     387    TExpression(Items[I]).Free;
     388  inherited;
     389end;
     390
    343391end.
    344392
Note: See TracChangeset for help on using the changeset viewer.