Ignore:
Timestamp:
Jan 17, 2018, 1:11:56 PM (7 years ago)
Author:
chronos
Message:
  • Added: Check memory leaks in debug build mode.
  • Fixed: Various memory leaks.
Location:
branches/easy compiler
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • branches/easy compiler

    • Property svn:ignore
      •  

        old new  
        22*.exe
        33*.lps
         4heaptrclog.trc
  • branches/easy compiler/USourceExecutor.pas

    r144 r145  
    1212  TInputEvent = function: string of object;
    1313
     14  { TExecutorVariable }
     15
    1416  TExecutorVariable = class
    1517    Variable: TSourceVariable;
    1618    Value: TSourceValue;
     19    destructor Destroy; override;
    1720  end;
    1821
     
    3942
    4043implementation
     44
     45{ TExecutorVariable }
     46
     47destructor TExecutorVariable.Destroy;
     48begin
     49  Value.Free;
     50  inherited Destroy;
     51end;
    4152
    4253
     
    110121      if Name = 'print' then begin
    111122        if Assigned(FOnOutput) then begin
    112           Value := ReadValueReference(Parameters[0]);
     123          Value := ReadValueReference(TSourceReference(Parameters[0]));
    113124          if Value is TSourceValueString then
    114125            FOnOutput(TSourceValueString(Value).Value)
     
    120131      if Name = 'println' then begin
    121132        if Assigned(FOnOutput) then begin
    122           Value := ReadValueReference(Parameters[0]);
     133          Value := ReadValueReference(TSourceReference(Parameters[0]));
    123134          if Value is TSourceValueString then
    124135            FOnOutput(TSourceValueString(Value).Value + LineEnding)
     
    130141      if Name = 'inputln' then begin
    131142        if Assigned(FOnInput) then begin
    132           Variable := ReadVarReference(Parameters[0]);
     143          Variable := ReadVarReference(TSourceReference(Parameters[0]));
    133144          ExecutorVar := Variables.Search(Variable);
    134145          if ExecutorVar.Value is TSourceValueString then begin
     
    147158      end else
    148159      if Name = 'assign' then begin
    149         Variable := ReadVarReference(Parameters[0]);
    150         Value := ReadValueReference(Parameters[1]);
     160        Variable := ReadVarReference(TSourceReference(Parameters[0]));
     161        Value := ReadValueReference(TSourceReference(Parameters[1]));
    151162        ExecutorVar := Variables.Search(Variable);
    152163        if not Assigned(ExecutorVar) then begin
     
    159170      end else
    160171      if Name = 'increment' then begin
    161         Variable := ReadVarReference(Parameters[0]);
    162         Value := ReadValueReference(Parameters[1]);
     172        Variable := ReadVarReference(TSourceReference(Parameters[0]));
     173        Value := ReadValueReference(TSourceReference(Parameters[1]));
    163174        ExecutorVar := Variables.Search(Variable);
    164175        if not Assigned(ExecutorVar) then raise Exception.Create('Variable not found');
Note: See TracChangeset for help on using the changeset viewer.