Changeset 290 for trunk/Start.pas


Ignore:
Timestamp:
Feb 26, 2021, 11:56:48 PM (3 years ago)
Author:
chronos
Message:
  • Modified: Use FreeAndNil instead of Free as defensive measure.
  • Modified: Use ihnerited without same method name specification.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Start.pas

    r283 r290  
    244244begin
    245245  FreeAndNil(Bitmap);
    246   inherited Destroy;
     246  inherited;
    247247end;
    248248
     
    471471      Brains.GetByKind(btAI, AIBrains);
    472472      BrainDefault := Brains[0];
    473       AIBrains.Free;
     473      FreeAndNil(AIBrains);
    474474    end; // default AI not found, use any
    475475
     
    698698    end;
    699699  end;
    700   AIBrains.Free;
     700  FreeAndNil(AIBrains);
    701701end;
    702702
     
    14111411      if AIBrains[I].Flags and fMultiple <> 0 then
    14121412        OfferBrain(AIBrains[I], FixedLines);
    1413     AIBrains.Free;
     1413    FreeAndNil(AIBrains);
    14141414  end else begin
    14151415    FixedLines := 0;
     
    14391439          or (Brains[I] = PlayersBrain[PlayerPopupIndex]) then
    14401440          OfferBrain(AIBrains[i], FixedLines);
    1441       AIBrains.Free;
     1441      FreeAndNil(AIBrains);
    14421442    end;
    14431443  end;
Note: See TracChangeset for help on using the changeset viewer.