Changeset 67


Ignore:
Timestamp:
Jul 19, 2012, 8:44:08 AM (12 years ago)
Author:
chronos
Message:
  • Fixed: Memory leaks in expression analyze.
Location:
trunk/Compiler
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/Compiler/Analyze/UAnalyzerPascal.pas

    r65 r67  
    155155  try
    156156    Expressions := TListExpression.Create;
    157     Expressions.OwnsObjects := False;
    158157    Expressions.Add(TExpression.Create);
    159158    with SourceCode do begin
     
    180179            TExpression(Expressions[I - 1]).SubItems.Last := Expressions[I];
    181180            TExpression(Expressions[I + 1]).SubItems.First := Expressions[I];
     181            Expressions.OwnsObjects := False;
     182            Expressions[I] := nil;
     183            Expressions.OwnsObjects := True;
    182184            Expressions.Delete(I);
    183185          end else Inc(I);
    184186        end;
    185187      end;
    186       if Assigned(TExpression(Expressions.First).SubItems.Last) then
     188      if Assigned(TExpression(Expressions.First).SubItems.Last) then begin
    187189        Assign(TExpression(TExpression(Expressions.First).SubItems.Last));
     190        SubItems.OwnsObjects := True;
     191        TExpression(TExpression(Expressions.First).SubItems.Last).SubItems.OwnsObjects := False;
     192        TExpression(Expressions.First).SubItems.Last.Free;
     193      end;
    188194      TExpression(Expressions.First).SubItems.Last := nil;
    189195      if Expressions.Count > 1 then
  • trunk/Compiler/TranspascalCompiler.lpk

    r64 r67  
    7272      </Item11>
    7373      <Item12>
     74        <Filename Value="Target\GCC\UTargetGCC.pas"/>
     75        <UnitName Value="UTargetGCC"/>
     76      </Item12>
     77      <Item13>
    7478        <Filename Value="Target\GCC\UProducerGCC.pas"/>
    7579        <UnitName Value="UProducerGCC"/>
    76       </Item12>
    77       <Item13>
    78         <Filename Value="Target\GCC\UTargetGCC.pas"/>
    79         <UnitName Value="UTargetGCC"/>
    8080      </Item13>
    8181      <Item14>
  • trunk/Compiler/TranspascalCompiler.pas

    r64 r67  
    1010  UCompiler, USourceCode, UProducer, UAnalyzer, UTarget, UExecutor,
    1111  UAnalyzerPascal, UTargets, UProducerDynamicc, UProducerASM8051,
    12   UTargetASM8051, UProducerGCC, UTargetGCC, UProducerPascal, UTargetDelphi,
     12  UTargetASM8051, UTargetGCC, UProducerGCC, UProducerPascal, UTargetDelphi,
    1313  UTargetPHP, UTargetJava, UTargetXML, UTargetInterpretter, UTargetNASM,
    1414  LazarusPackageIntf;
Note: See TracChangeset for help on using the changeset viewer.