Changeset 221 for branches/interpreter2/USource.pas
- Timestamp:
- Nov 24, 2020, 6:19:17 PM (4 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/interpreter2/USource.pas
r213 r221 154 154 function GetField(Index: Integer): TField; override; 155 155 procedure SetValue(Index: Integer; var Value); override; 156 destructor Destroy; override; 156 157 end; 157 158 … … 484 485 destructor TReturn.Destroy; 485 486 begin 486 Expression.Free;487 inherited Destroy;487 FreeAndNil(Expression); 488 inherited; 488 489 end; 489 490 … … 530 531 destructor TSourceNodes.Destroy; 531 532 begin 532 List.Free;533 inherited Destroy;533 FreeAndNil(List); 534 inherited; 534 535 end; 535 536 … … 588 589 else if Index = 1 then TypeRef := TType(Value) 589 590 else inherited; 591 end; 592 593 destructor TConstant.Destroy; 594 begin 595 FreeAndNil(Value); 596 inherited; 590 597 end; 591 598 … … 722 729 destructor TRepeatUntil.Destroy; 723 730 begin 724 Expression.Free;725 Commands.Free;726 inherited Destroy;731 FreeAndNil(Expression); 732 FreeAndNil(Commands); 733 inherited; 727 734 end; 728 735 … … 801 808 destructor TForToDo.Destroy; 802 809 begin 803 Command.Free;804 ExpressionTo.Free;805 ExpressionFrom.Free;806 inherited Destroy;810 FreeAndNil(Command); 811 FreeAndNil(ExpressionTo); 812 FreeAndNil(ExpressionFrom); 813 inherited; 807 814 end; 808 815 … … 868 875 destructor TExpressionOperand.Destroy; 869 876 begin 870 if Assigned(ConstantDirect) then ConstantDirect.Free; 877 if Assigned(ConstantDirect) then FreeAndNil(ConstantDirect); 878 if Assigned(FunctionCall) then FreeAndNil(FunctionCall); 871 879 end; 872 880 … … 933 941 destructor TFunction.Destroy; 934 942 begin 935 Block.Free;936 Params.Free;937 inherited Destroy;943 FreeAndNil(Block); 944 FreeAndNil(Params); 945 inherited; 938 946 end; 939 947 … … 971 979 destructor TType.Destroy; 972 980 begin 973 F unctions.Free;974 inherited Destroy;981 FreeAndNil(Functions); 982 inherited; 975 983 end; 976 984 … … 1033 1041 destructor TExpressionOperation.Destroy; 1034 1042 begin 1035 Items.Free;1036 inherited Destroy;1043 FreeAndNil(Items); 1044 inherited; 1037 1045 end; 1038 1046 … … 1079 1087 begin 1080 1088 Variable := nil; 1081 Expression.Free;1082 inherited Destroy;1089 FreeAndNil(Expression); 1090 inherited; 1083 1091 end; 1084 1092 … … 1123 1131 destructor TIfThenElse.Destroy; 1124 1132 begin 1125 Expression.Free;1126 CommandThen.Free;1127 CommandElse.Free;1128 inherited Destroy;1133 FreeAndNil(Expression); 1134 FreeAndNil(CommandThen); 1135 FreeAndNil(CommandElse); 1136 inherited; 1129 1137 end; 1130 1138 … … 1165 1173 destructor TWhileDo.Destroy; 1166 1174 begin 1167 Expression.Free;1168 Command.Free;1169 inherited Destroy;1175 FreeAndNil(Expression); 1176 FreeAndNil(Command); 1177 inherited; 1170 1178 end; 1171 1179 … … 1205 1213 destructor TFunctionCall.Destroy; 1206 1214 begin 1207 Params.Free;1208 inherited Destroy;1215 FreeAndNil(Params); 1216 inherited; 1209 1217 end; 1210 1218 … … 1349 1357 destructor TBlock.Destroy; 1350 1358 begin 1351 BeginEnd.Free;1352 Types.Free;1353 Variables.Free;1354 Constants.Free;1355 F unctions.Free;1356 inherited Destroy;1359 FreeAndNil(BeginEnd); 1360 FreeAndNil(Types); 1361 FreeAndNil(Variables); 1362 FreeAndNil(Constants); 1363 FreeAndNil(Functions); 1364 inherited; 1357 1365 end; 1358 1366 … … 1394 1402 destructor TBeginEnd.Destroy; 1395 1403 begin 1396 Commands.Free;1397 inherited Destroy;1404 FreeAndNil(Commands); 1405 inherited; 1398 1406 end; 1399 1407 … … 1439 1447 destructor TProgram.Destroy; 1440 1448 begin 1441 Block.Free;1442 SystemBlock.Free;1443 inherited Destroy;1449 FreeAndNil(Block); 1450 FreeAndNil(SystemBlock); 1451 inherited; 1444 1452 end; 1445 1453
Note:
See TracChangeset
for help on using the changeset viewer.