- Timestamp:
- Feb 26, 2021, 11:56:48 PM (4 years ago)
- Location:
- trunk
- Files:
-
- 28 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/CmdList.pas
r38 r290 57 57 constructor TCmdList.Create; 58 58 begin 59 inherited Create;59 inherited; 60 60 FState.nLog := 0; 61 61 LogAlloc := 0; … … 69 69 begin 70 70 ReallocMem(LogData, 0); 71 inherited Destroy;71 inherited; 72 72 end; 73 73 -
trunk/Database.pas
r227 r290 1082 1082 else 1083 1083 result := 0; 1084 Q.Free;1084 FreeAndNil(Q); 1085 1085 end; 1086 1086 -
trunk/GameServer.pas
r288 r290 7 7 8 8 uses 9 Protocol, Database, dynlibs, Platform, dateutils, fgl, LazFileUtils, Graphics; 9 Protocol, Database, dynlibs, Platform, dateutils, fgl, LazFileUtils, 10 Graphics; 10 11 11 12 const … … 289 290 FreeLibrary(hm); 290 291 end; 291 PlayersBrain.Free;292 bix.Free;293 Brains.Free;292 FreeAndNil(PlayersBrain); 293 FreeAndNil(bix); 294 FreeAndNil(Brains); 294 295 end; 295 296 … … 561 562 MapFile := TFileStream.Create(GetMapsDir + DirectorySeparator + FileName, 562 563 fmCreate or fmShareExclusive); 563 MapFile.Position := 0; 564 s := 'cEvoMap'#0; 565 MapFile.write(s[1], 8); { file id } 566 i := 0; 567 MapFile.write(i, 4); { format id } 568 MapFile.write(MaxTurn, 4); 569 MapFile.write(lx, 4); 570 MapFile.write(ly, 4); 571 MapFile.write(RealMap, MapSize * 4); 572 MapFile.Free; 564 try 565 MapFile.Position := 0; 566 s := 'cEvoMap'#0; 567 MapFile.write(s[1], 8); { file id } 568 i := 0; 569 MapFile.write(i, 4); { format id } 570 MapFile.write(MaxTurn, 4); 571 MapFile.write(lx, 4); 572 MapFile.write(ly, 4); 573 MapFile.write(RealMap, MapSize * 4); 574 finally 575 FreeAndNil(MapFile); 576 end; 573 577 end; 574 578 … … 613 617 result := true; 614 618 end; 615 MapFile.Free;619 FreeAndNil(MapFile); 616 620 except 617 621 if MapFile <> nil then 618 MapFile.Free;622 FreeAndNil(MapFile); 619 623 end; 620 624 end; … … 694 698 else 695 699 CL.SaveToFile(LogFile); 696 LogFile.Free;700 FreeAndNil(LogFile); 697 701 if auto then 698 702 begin … … 721 725 Brains.GetByKind(btAI, AIBrains); 722 726 bix[p1] := AIBrains[DelphiRandom(AIBrains.Count)]; 723 AIBrains.Free;727 FreeAndNil(AIBrains); 724 728 end 725 729 else … … 992 996 CityProcessing.ReleaseGame; 993 997 Database.ReleaseGame; 994 CL.Free;998 FreeAndNil(CL); 995 999 end; 996 1000 … … 1190 1194 CL.LoadFromFile(LogFile); 1191 1195 end; 1192 LogFile.Free;1196 FreeAndNil(LogFile); 1193 1197 if not result then 1194 1198 Exit; … … 4604 4608 begin 4605 4609 FreeAndNil(Picture); 4606 inherited Destroy;4610 inherited; 4607 4611 end; 4608 4612 -
trunk/IPQ.pas
r38 r290 47 47 GetMem(Ix, fmax * sizeof(integer)); 48 48 n := -1; 49 Empty 49 Empty; 50 50 end; 51 51 … … 54 54 FreeMem(bh); 55 55 FreeMem(Ix); 56 inherited Destroy;56 inherited; 57 57 end; 58 58 -
trunk/LocalPlayer/Help.pas
r261 r290 208 208 destructor THyperText.Destroy; 209 209 begin 210 inherited Destroy;210 inherited; 211 211 end; 212 212 … … 1237 1237 until FindNext(sr) <> 0; 1238 1238 FindClose(sr); 1239 Plus.Free;1239 FreeAndNil(Plus); 1240 1240 1241 1241 List.Sort; … … 1254 1254 MainText.AddLine(s); 1255 1255 end; 1256 List.Free;1256 FreeAndNil(List); 1257 1257 end; 1258 1258 … … 1272 1272 MainText.AddLine(s); 1273 1273 end; 1274 List.Free;1274 FreeAndNil(List); 1275 1275 end; 1276 1276 … … 1434 1434 AppendList(List); 1435 1435 end; 1436 List.Free;1436 FreeAndNil(List); 1437 1437 end 1438 1438 else // single advance … … 1533 1533 List.Sort; 1534 1534 AppendList(List); 1535 List.Free;1535 FreeAndNil(List); 1536 1536 end 1537 1537 else if no = 201 then … … 1822 1822 AppendList(List); 1823 1823 end; 1824 List.Free;1824 FreeAndNil(List); 1825 1825 end 1826 1826 else … … 1983 1983 OffscreenPaint; 1984 1984 Invalidate; 1985 HistItem.Free;1985 FreeAndNil(HistItem); 1986 1986 end; 1987 1987 end; -
trunk/LocalPlayer/IsoEngine.pas
r245 r290 133 133 OnInitEnemyModel := InitEnemyModelHandler; 134 134 if NoMap <> nil then 135 NoMap.Free;135 FreeAndNil(NoMap); 136 136 NoMap := TIsoMap.Create; 137 137 end; … … 168 168 { prepare dithered ground tiles } 169 169 if LandPatch <> nil then 170 LandPatch.Free;170 FreeAndNil(LandPatch); 171 171 LandPatch := TBitmap.Create; 172 172 LandPatch.PixelFormat := pf24bit; … … 175 175 LandPatch.Canvas.FillRect(0, 0, LandPatch.Width, LandPatch.Height); 176 176 if OceanPatch <> nil then 177 OceanPatch.Free;177 FreeAndNil(OceanPatch); 178 178 OceanPatch := TBitmap.Create; 179 179 OceanPatch.PixelFormat := pf24bit; … … 363 363 DitherMask.Canvas, 0, 0, SRCAND); 364 364 365 LandMore.Free;366 OceanMore.Free;367 DitherMask.Free;365 FreeAndNil(LandMore); 366 FreeAndNil(OceanMore); 367 FreeAndNil(DitherMask); 368 368 369 369 // reduce size of terrain icons … … 418 418 end; 419 419 Mask24.EndUpdate; 420 Mask24.Free;420 FreeAndNil(Mask24); 421 421 422 422 if Borders <> nil then 423 Borders.Free;423 FreeAndNil(Borders); 424 424 Borders := TBitmap.Create; 425 425 Borders.PixelFormat := pf24bit; -
trunk/LocalPlayer/MessgEx.lfm
r232 r290 1 1 object MessgExDlg: TMessgExDlg 2 2 Left = 463 3 Height = 134 3 4 Top = 164 5 Width = 418 4 6 BorderIcons = [] 5 7 BorderStyle = bsNone … … 8 10 ClientWidth = 418 9 11 Color = clBtnFace 10 Font.Charset = DEFAULT_CHARSET12 DesignTimePPI = 144 11 13 Font.Color = clWindowText 12 14 Font.Height = -13 13 15 Font.Name = 'MS Sans Serif' 14 Font.Style = []15 16 FormStyle = fsStayOnTop 16 17 OnClose = FormClose … … 19 20 OnPaint = FormPaint 20 21 OnShow = FormShow 21 PixelsPerInch = 9622 LCLVersion = '2.0.12.0' 22 23 Scaled = False 23 24 object Button1: TButtonA 24 25 Left = 43 26 Height = 25 25 27 Top = 104 26 28 Width = 100 27 Height = 2528 29 Down = False 29 30 Permanent = False 30 31 OnClick = Button1Click 31 Caption = ''32 32 end 33 33 object Button2: TButtonA 34 34 Left = 159 35 Height = 25 35 36 Top = 104 36 37 Width = 100 37 Height = 2538 38 Down = False 39 39 Permanent = False 40 40 OnClick = Button2Click 41 Caption = ''42 41 end 43 42 object Button3: TButtonA 44 43 Left = 275 44 Height = 25 45 45 Top = 104 46 46 Width = 100 47 Height = 2548 47 Down = False 49 48 Permanent = False 50 49 OnClick = Button3Click 51 Caption = ''52 50 end 53 51 object RemoveBtn: TButtonB 54 52 Left = 384 53 Height = 25 55 54 Top = 104 56 55 Width = 25 57 Height = 2558 56 Down = False 59 57 Permanent = False … … 63 61 object EInput: TEdit 64 62 Left = 125 63 Height = 26 65 64 Top = 64 66 65 Width = 168 67 Height = 1968 TabStop = False69 66 BorderStyle = bsNone 70 67 Color = clBlack 71 Font.Charset = DEFAULT_CHARSET72 68 Font.Color = 4176863 73 69 Font.Height = -15 … … 75 71 Font.Style = [fsBold] 76 72 ParentFont = False 73 TabStop = False 77 74 TabOrder = 0 78 75 end -
trunk/LocalPlayer/MessgEx.pas
r245 r290 218 218 end 219 219 else 220 result := inherited ShowModal;220 result := inherited; 221 221 end; 222 222 -
trunk/LocalPlayer/NatStat.pas
r189 r290 98 98 procedure TNatStatDlg.FormDestroy(Sender: TObject); 99 99 begin 100 ReportText.Free;100 FreeAndNil(ReportText); 101 101 FreeMem(SelfReport); 102 Template.Free;103 Back.Free;102 FreeAndNil(Template); 103 FreeAndNil(Back); 104 104 end; 105 105 -
trunk/LocalPlayer/Term.pas
r288 r290 1243 1243 if AILogo[p] <> nil then 1244 1244 begin 1245 AILogo[p].free; 1246 AILogo[p] := nil 1245 FreeAndNil(AILogo[p]); 1247 1246 end 1248 1247 end … … 1253 1252 if not LoadGraphicFile(AILogo[p], HomeDir + Name + '.png', gfNoError) then 1254 1253 begin 1255 AILogo[p].free; 1256 AILogo[p] := nil 1254 FreeAndNil(AILogo[p]); 1257 1255 end 1258 1256 end … … 2497 2495 cReleaseModule: 2498 2496 begin 2499 SmallImp.free;2500 UnusedTribeFiles.free;2501 TribeNames.free;2502 MainMap.free;2497 FreeAndNil(SmallImp); 2498 FreeAndNil(UnusedTribeFiles); 2499 FreeAndNil(TribeNames); 2500 FreeAndNil(MainMap); 2503 2501 IsoEngine.Done; 2504 2502 // AdvisorDlg.DeInit; … … 2698 2696 for p1 := 0 to nPl - 1 do 2699 2697 if Tribe[p1] <> nil then 2700 Tribe[p1].free;2698 FreeAndNil(Tribe[p1]); 2701 2699 Tribes.Done; 2702 2700 RepaintOnResize := false; -
trunk/LocalPlayer/Tribes.pas
r98 r290 90 90 begin 91 91 ReallocMem(PictureList, 0); 92 StdUnitScript.Free;92 FreeAndNil(StdUnitScript); 93 93 end; 94 94 … … 313 313 destructor TTribe.Destroy; 314 314 begin 315 Script.Free;316 inherited Destroy;315 FreeAndNil(Script); 316 inherited; 317 317 end; 318 318 -
trunk/LocalPlayer/UnitStat.pas
r209 r290 88 88 procedure TUnitStatDlg.FormDestroy(Sender: TObject); 89 89 begin 90 Template.Free;91 Back.Free;90 FreeAndNil(Template); 91 FreeAndNil(Back); 92 92 end; 93 93 -
trunk/NoTerm.pas
r188 r290 25 25 G: TNewGameData; 26 26 Server: TServerCall; 27 Shade, State: TBitmap; 27 Shade: TBitmap; 28 State: TBitmap; 28 29 WinStat, ExtStat, AloneStat: array [0 .. nPl - 1] of integer; 29 30 DisallowShowActive: array [0 .. nPl - 1] of boolean; … … 163 164 cReleaseModule: 164 165 begin 165 Shade.Free;166 State.Free;166 FreeAndNil(Shade); 167 FreeAndNil(State); 167 168 end; 168 169 … … 245 246 ShipComplete := false; 246 247 if ShipComplete then 247 inc(WinStat[p]) 248 inc(WinStat[p]); 248 249 end; 249 250 if Mode = Running then … … 255 256 begin 256 257 GoBtn.ButtonIndex := 22; 257 Mode := Stopped 258 end 258 Mode := Stopped; 259 end; 259 260 end; 260 261 … … 277 278 if (Active >= 0) and not DisallowShowActive[Active] then 278 279 ShowActive(Active, true); 279 end 280 281 end 280 end; 281 end; 282 282 end; 283 283 … … 292 292 GoBtn.Update; 293 293 Server(sTurn, me, 0, nil^); 294 end 294 end; 295 295 end; 296 296 … … 300 300 EndPlaying 301 301 else 302 Mode := Quit 302 Mode := Quit; 303 303 end; 304 304 -
trunk/Packages/CevoComponents/AsyncProcess2.pas
r287 r290 104 104 procedure TAsyncProcess.Execute; 105 105 begin 106 inherited Execute;106 inherited; 107 107 108 108 if poUsePipes in Options then -
trunk/Packages/CevoComponents/BaseWin.pas
r188 r290 106 106 destructor TBufferedDrawDlg.Destroy; 107 107 begin 108 Offscreen.Free;109 inherited Destroy;108 FreeAndNil(Offscreen); 109 inherited; 110 110 end; 111 111 -
trunk/Packages/CevoComponents/ButtonA.pas
r209 r290 35 35 constructor TButtonA.Create(aOwner: TComponent); 36 36 begin 37 inherited Create(aOwner);37 inherited; 38 38 FCaption := ''; 39 39 SetBounds(0, 0, 100, 25); -
trunk/Packages/CevoComponents/ButtonB.pas
r188 r290 38 38 constructor TButtonB.Create(aOwner: TComponent); 39 39 begin 40 inherited Create(aOwner);40 inherited; 41 41 ShowHint := True; 42 42 SetBounds(0, 0, 25, 25); -
trunk/Packages/CevoComponents/ButtonC.pas
r188 r290 32 32 constructor TButtonC.Create(aOwner: TComponent); 33 33 begin 34 inherited Create(aOwner);34 inherited; 35 35 ShowHint := True; 36 36 SetBounds(0, 0, 12, 12); -
trunk/Packages/CevoComponents/ButtonN.pas
r188 r290 45 45 constructor TButtonN.Create(aOwner: TComponent); 46 46 begin 47 inherited Create(aOwner);47 inherited; 48 48 ShowHint := true; 49 49 FGraphic := nil; -
trunk/Packages/CevoComponents/DrawDlg.pas
r257 r290 77 77 begin 78 78 RemoveHandlerOnVisibleChanged(VisibleChangedHandler); 79 inherited Destroy;79 inherited; 80 80 end; 81 81 … … 175 175 begin 176 176 if Key = VK_ESCAPE then Close; 177 inherited KeyDown(Key, Shift);177 inherited; 178 178 end; 179 179 -
trunk/Packages/CevoComponents/ScreenTools.pas
r288 r290 258 258 MenuItem := MenuItems[MenuItems.Count - 1]; 259 259 MenuItems.Delete(MenuItems.Count - 1); 260 MenuItem.Free;260 FreeAndNil(MenuItem); 261 261 end; 262 262 end; … … 439 439 Bmp.Canvas.Draw(0, 0, jtex); 440 440 end; 441 jtex.Free;441 FreeAndNil(jtex); 442 442 end 443 443 else … … 464 464 Bmp.Canvas.draw(0, 0, Png); 465 465 end; 466 Png.Free;466 FreeAndNil(Png); 467 467 end 468 468 else … … 1726 1726 RestoreResolution; 1727 1727 for I := 0 to nGrExt - 1 do begin 1728 GrExt[I].Data.Free;1729 GrExt[I].Mask.Free;1728 FreeAndNil(GrExt[I].Data); 1729 FreeAndNil(GrExt[I].Mask); 1730 1730 FreeMem(GrExt[I]); 1731 1731 end; -
trunk/Packages/CevoComponents/Sound.lfm
r111 r290 8 8 Caption = 'SoundPlayer' 9 9 Color = clBtnFace 10 DesignTimePPI = 1 2510 DesignTimePPI = 144 11 11 Font.Color = clWindowText 12 12 Font.Height = -11 13 13 Font.Name = 'MS Sans Serif' 14 LCLVersion = ' 1.8.0.6'14 LCLVersion = '2.0.12.0' 15 15 Scaled = False 16 16 end -
trunk/Packages/CevoComponents/Sound.pas
r288 r290 220 220 end; 221 221 finally 222 L.Free;222 FreeAndNil(L); 223 223 end; 224 224 end -
trunk/Platform.pas
r207 r290 58 58 finalization 59 59 60 NowPreciseLock.Free;60 FreeAndNil(NowPreciseLock); 61 61 62 62 end. -
trunk/Start.lfm
r232 r290 25 25 OnPaint = FormPaint 26 26 OnShow = FormShow 27 LCLVersion = '2.0.2.0' 28 PixelsPerInch = 96 27 LCLVersion = '2.0.12.0' 29 28 Scaled = False 30 29 object StartBtn: TButtonA … … 205 204 end 206 205 object PopupMenu1: TPopupMenu 207 left = 8208 top = 8206 Left = 8 207 Top = 8 209 208 end 210 209 end -
trunk/Start.pas
r283 r290 244 244 begin 245 245 FreeAndNil(Bitmap); 246 inherited Destroy;246 inherited; 247 247 end; 248 248 … … 471 471 Brains.GetByKind(btAI, AIBrains); 472 472 BrainDefault := Brains[0]; 473 AIBrains.Free;473 FreeAndNil(AIBrains); 474 474 end; // default AI not found, use any 475 475 … … 698 698 end; 699 699 end; 700 AIBrains.Free;700 FreeAndNil(AIBrains); 701 701 end; 702 702 … … 1411 1411 if AIBrains[I].Flags and fMultiple <> 0 then 1412 1412 OfferBrain(AIBrains[I], FixedLines); 1413 AIBrains.Free;1413 FreeAndNil(AIBrains); 1414 1414 end else begin 1415 1415 FixedLines := 0; … … 1439 1439 or (Brains[I] = PlayersBrain[PlayerPopupIndex]) then 1440 1440 OfferBrain(AIBrains[i], FixedLines); 1441 AIBrains.Free;1441 FreeAndNil(AIBrains); 1442 1442 end; 1443 1443 end; -
trunk/UKeyBindings.pas
r288 r290 97 97 end; 98 98 finally 99 Lines.Free;99 FreeAndNil(Lines); 100 100 end; 101 101 end; … … 114 114 Lines.SaveToFile(FileName); 115 115 finally 116 Lines.Free;116 FreeAndNil(Lines); 117 117 end; 118 118 end; -
trunk/UnitProcessing.pas
r38 r290 5 5 6 6 uses 7 Protocol, Database;7 SysUtils, Protocol, Database; 8 8 9 9 type … … 1035 1035 end 1036 1036 end; 1037 Q.Free;1037 FreeAndNil(Q); 1038 1038 if (Loc = a.ToLoc) or (a.ToLoc = maNextCity) and (Loc >= 0) and 1039 1039 (Map[Loc] and fCity <> 0) then … … 1165 1165 end 1166 1166 end; 1167 Q.Free;1167 FreeAndNil(Q); 1168 1168 end; // CanPlaneReturn 1169 1169
Note:
See TracChangeset
for help on using the changeset viewer.