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/LocalPlayer/IsoEngine.pas

    r245 r290  
    133133  OnInitEnemyModel := InitEnemyModelHandler;
    134134  if NoMap <> nil then
    135     NoMap.Free;
     135    FreeAndNil(NoMap);
    136136  NoMap := TIsoMap.Create;
    137137end;
     
    168168  { prepare dithered ground tiles }
    169169  if LandPatch <> nil then
    170     LandPatch.Free;
     170    FreeAndNil(LandPatch);
    171171  LandPatch := TBitmap.Create;
    172172  LandPatch.PixelFormat := pf24bit;
     
    175175  LandPatch.Canvas.FillRect(0, 0, LandPatch.Width, LandPatch.Height);
    176176  if OceanPatch <> nil then
    177     OceanPatch.Free;
     177    FreeAndNil(OceanPatch);
    178178  OceanPatch := TBitmap.Create;
    179179  OceanPatch.PixelFormat := pf24bit;
     
    363363      DitherMask.Canvas, 0, 0, SRCAND);
    364364
    365   LandMore.Free;
    366   OceanMore.Free;
    367   DitherMask.Free;
     365  FreeAndNil(LandMore);
     366  FreeAndNil(OceanMore);
     367  FreeAndNil(DitherMask);
    368368
    369369  // reduce size of terrain icons
     
    418418  end;
    419419  Mask24.EndUpdate;
    420   Mask24.Free;
     420  FreeAndNil(Mask24);
    421421
    422422  if Borders <> nil then
    423     Borders.Free;
     423    FreeAndNil(Borders);
    424424  Borders := TBitmap.Create;
    425425  Borders.PixelFormat := pf24bit;
Note: See TracChangeset for help on using the changeset viewer.