Changeset 12


Ignore:
Timestamp:
Jan 7, 2017, 8:25:59 PM (7 years ago)
Author:
chronos
Message:
  • Fixed: Various memory leaks.
  • Fixed: Exceptions during browsing in help.
Location:
trunk
Files:
1 deleted
10 edited

Legend:

Unmodified
Added
Removed
  • trunk/Integrated.lpi

    r11 r12  
    131131        <Filename Value="Start.pas"/>
    132132        <IsPartOfProject Value="True"/>
    133         <HasResources Value="True"/>
     133        <ComponentName Value="StartDlg"/>
     134        <HasResources Value="True"/>
     135        <ResourceBaseClass Value="Form"/>
    134136      </Unit11>
    135137      <Unit12>
     
    182184        <Filename Value="LocalPlayer\Term.pas"/>
    183185        <IsPartOfProject Value="True"/>
    184         <HasResources Value="True"/>
     186        <ComponentName Value="MainScreen"/>
     187        <HasResources Value="True"/>
     188        <ResourceBaseClass Value="Form"/>
    185189      </Unit22>
    186190      <Unit23>
     
    236240        <Filename Value="LocalPlayer\Nego.pas"/>
    237241        <IsPartOfProject Value="True"/>
    238         <HasResources Value="True"/>
     242        <ComponentName Value="NegoDlg"/>
     243        <HasResources Value="True"/>
     244        <ResourceBaseClass Value="Form"/>
    239245      </Unit33>
    240246      <Unit34>
  • trunk/LocalPlayer/CityScreen.pas

    r9 r12  
    240240  SmallCityMap.Free;
    241241  ZoomCityMap.Free;
     242  SmallCityMapTemplate.Free;
    242243  CityMapTemplate.Free;
    243244  Template.Free;
  • trunk/LocalPlayer/Draft.pas

    r9 r12  
    9797procedure TDraftDlg.FormDestroy(Sender: TObject);
    9898begin
    99   Template.Free;
     99  FreeAndNil(Template);
     100  FreeAndNil(Back);
    100101end;
    101102
  • trunk/LocalPlayer/Help.pas

    r9 r12  
    3737
    3838type
     39
     40  { THyperText }
     41
    3942  THyperText = class(TStringList)
    4043    procedure AddLine(s: String = ''; Format: integer = 0; Picpix: integer = 0;
    4144      LinkCategory: integer = 0; LinkIndex: integer = 0);
     45    procedure AddText(Const S : String); override;
    4246    procedure LF;
     47    destructor Destroy; override;
    4348  end;
    4449
     
    122127end;
    123128
     129procedure THyperText.AddText(const S: String);
     130begin
     131  AddLine(S);
     132end;
     133
    124134procedure THyperText.LF;
    125135begin
    126136  AddLine;
     137end;
     138
     139destructor THyperText.Destroy;
     140begin
     141  inherited Destroy;
    127142end;
    128143
     
    189204  inc(ModalFrameIndent, 29);
    190205  MainText := THyperText.Create;
     206  MainText.OwnsObjects := True;
    191207  SearchResult := THyperText.Create;
     208  SearchResult.OwnsObjects := True;
    192209  CreatePVSB(sb, Handle, 36, 551, 36 + 432);
    193210
     
    226243procedure THelpDlg.FormDestroy(Sender: TObject);
    227244begin
    228   MainText.Free;
    229   SearchResult.Free;
    230   ExtPic.Free;
    231   TerrIcon.Free;
    232   HelpText.Free;
    233   // CaptionFont.Free;
     245  FreeAndNil(MainText);
     246  FreeAndNil(SearchResult);
     247  FreeAndNil(ExtPic);
     248  FreeAndNil(TerrIcon);
     249  FreeAndNil(HelpText);
     250  // FreeAndNil(CaptionFont);
    234251end;
    235252
  • trunk/LocalPlayer/Nego.pas

    r9 r12  
    1212const
    1313  MaxHistory = 62;
     14  scDipNoticeStart = scDipNotice - scDipStart;
     15  scDipBreakStart = scDipBreak - scDipStart;
    1416
    1517type
     
    1820    Text: array [0 .. MaxHistory - 1] of ansistring;
    1921  end;
     22
     23  TCommandAllowedEnum = scDipNoticeStart .. scDipBreakStart;
     24
     25  { TNegoDlg }
    2026
    2127  TNegoDlg = class(TBufferedDrawDlg)
     
    5359    CancelTreatyBtn: TButtonN;
    5460    procedure FormCreate(Sender: TObject);
     61    procedure FormDestroy(Sender: TObject);
    5562    procedure FormMouseDown(Sender: TObject; Button: TMouseButton;
    5663      Shift: TShiftState; X, Y: integer);
     
    7683    CurrentOffer: TOffer;
    7784    MyAllowed, OppoAllowed: TPriceSet;
    78     CommandAllowed: set of scDipNotice - scDipStart .. scDipBreak - scDipStart;
     85    CommandAllowed: set of TCommandAllowedEnum;
    7986    History: array [0 .. nPl - 1] of THistory;
    8087    RomanFont: TFont;
     
    167174end;
    168175
     176procedure TNegoDlg.FormDestroy(Sender: TObject);
     177begin
     178  FreeAndNil(RomanFont);
     179end;
     180
    169181procedure TNegoDlg.FormShow(Sender: TObject);
    170182begin
  • trunk/LocalPlayer/Term.lfm

    r9 r12  
    11object MainScreen: TMainScreen
    22  Left = 231
     3  Height = 480
    34  Top = 190
     5  Width = 800
    46  HorzScrollBar.Visible = False
    57  VertScrollBar.Visible = False
    68  Caption = 'C-evo'
    7   ClientHeight = 435
    8   ClientWidth = 782
     9  ClientHeight = 480
     10  ClientWidth = 800
    911  Color = clBtnFace
    1012  Constraints.MinHeight = 480
    1113  Constraints.MinWidth = 800
    12   Font.Charset = DEFAULT_CHARSET
    1314  Font.Color = clWindowText
    1415  Font.Height = -13
    1516  Font.Name = 'MS Sans Serif'
    16   Font.Style = []
    1717  KeyPreview = True
    18   Position = poDefault
    19   WindowState = wsMaximized
    2018  OnClose = FormClose
    2119  OnCloseQuery = FormCloseQuery
     
    3028  OnResize = FormResize
    3129  OnShow = FormShow
    32   PixelsPerInch = 96
     30  Position = poDefault
     31  LCLVersion = '1.6.2.0'
     32  WindowState = wsMaximized
    3333  object UnitBtn: TButtonB
    3434    Tag = 14
    3535    Left = 208
     36    Height = 25
    3637    Top = 384
    3738    Width = 25
    38     Height = 25
    3939    Visible = False
    4040    Down = False
     
    4646    Tag = 51
    4747    Left = 16
     48    Height = 12
    4849    Top = 304
    4950    Width = 12
    50     Height = 12
    5151    Visible = False
    5252    Down = False
     
    5858    Tag = 291
    5959    Left = 16
     60    Height = 12
    6061    Top = 320
    6162    Width = 12
    62     Height = 12
    6363    Visible = False
    6464    Down = False
     
    7070    Tag = 1028
    7171    Left = 16
     72    Height = 12
    7273    Top = 368
    7374    Width = 12
    74     Height = 12
    7575    Visible = False
    7676    Down = False
     
    8282    Tag = 1328
    8383    Left = 16
     84    Height = 12
    8485    Top = 384
    8586    Width = 12
    86     Height = 12
    8787    Visible = False
    8888    Down = False
     
    9494    Tag = 1541
    9595    Left = 16
     96    Height = 12
    9697    Top = 400
    9798    Width = 12
    98     Height = 12
    9999    Visible = False
    100100    Down = False
     
    106106    Tag = 28
    107107    Left = 240
     108    Height = 25
    108109    Top = 384
    109110    Width = 25
    110     Height = 25
    111111    Visible = False
    112112    Down = False
     
    118118    Tag = 15
    119119    Left = 176
     120    Height = 25
    120121    Top = 384
    121122    Width = 25
    122     Height = 25
    123123    Visible = False
    124124    Down = False
     
    129129  object EOT: TEOTButton
    130130    Left = 712
     131    Height = 48
    131132    Top = 368
    132133    Width = 48
    133     Height = 48
    134134    Visible = False
    135135    Down = False
     
    140140  object MenuArea: TArea
    141141    Left = 2
     142    Height = 36
    142143    Top = 1
    143144    Width = 36
    144     Height = 36
    145145  end
    146146  object TreasuryArea: TArea
    147147    Left = 208
     148    Height = 36
    148149    Top = 1
    149150    Width = 164
    150     Height = 36
    151151  end
    152152  object ResearchArea: TArea
    153153    Left = 384
     154    Height = 36
    154155    Top = 1
    155156    Width = 240
    156     Height = 36
    157157  end
    158158  object ManagementArea: TArea
    159159    Left = 704
     160    Height = 40
    160161    Top = 312
    161162    Width = 56
    162     Height = 40
    163163  end
    164164  object MovieSpeed1Btn: TButtonB
    165165    Tag = 256
    166166    Left = 384
     167    Height = 25
    167168    Top = 384
    168169    Width = 25
    169     Height = 25
    170170    Visible = False
    171171    Down = False
     
    177177    Tag = 512
    178178    Left = 416
     179    Height = 25
    179180    Top = 384
    180181    Width = 25
    181     Height = 25
    182182    Visible = False
    183183    Down = False
     
    189189    Tag = 768
    190190    Left = 448
     191    Height = 25
    191192    Top = 384
    192193    Width = 25
    193     Height = 25
    194194    Visible = False
    195195    Down = False
     
    201201    Tag = 1024
    202202    Left = 480
     203    Height = 25
    203204    Top = 384
    204205    Width = 25
    205     Height = 25
    206206    Visible = False
    207207    Down = False
     
    214214    Interval = 50
    215215    OnTimer = Timer1Timer
    216     Left = 8
    217     Top = 48
     216    left = 8
     217    top = 48
    218218  end
    219219  object GamePopup: TPopupMenu
    220220    AutoPopup = False
    221     Left = 40
    222     Top = 48
     221    left = 40
     222    top = 48
    223223    object mHelp: TMenuItem
    224224      Tag = 7
     
    249249        Tag = 30
    250250        GroupIndex = 1
     251        RadioItem = True
    251252        object mSlowMoves: TMenuItem
    252253          Tag = 75
     
    275276        Tag = 90
    276277        GroupIndex = 1
     278        RadioItem = True
    277279        object mAlSlowMoves: TMenuItem
    278280          Tag = 91
     
    301303        Tag = 74
    302304        GroupIndex = 1
     305        RadioItem = True
    303306        object mEnMoves: TMenuItem
    304307          Tag = 78
     
    327330        Caption = '-'
    328331        GroupIndex = 1
     332        RadioItem = True
    329333      end
    330334      object mRepList: TMenuItem
     
    575579  object UnitPopup: TPopupMenu
    576580    AutoPopup = False
    577     Left = 104
    578     Top = 48
     581    left = 104
     582    top = 48
    579583    object mdisband: TMenuItem
    580584      Tag = 72
     
    658662  object StatPopup: TPopupMenu
    659663    AutoPopup = False
    660     Left = 72
    661     Top = 48
     664    left = 72
     665    top = 48
    662666    object mUnitStat: TMenuItem
    663667      Tag = 9
     
    714718  end
    715719  object EditPopup: TPopupMenu
    716     Left = 168
    717     Top = 48
     720    left = 168
     721    top = 48
    718722    object mCreateUnit: TMenuItem
    719723      Tag = 47
     
    721725  end
    722726  object TerrainPopup: TPopupMenu
    723     Left = 136
    724     Top = 48
     727    left = 136
     728    top = 48
    725729    object mtrans: TMenuItem
    726730      Tag = 273
  • trunk/LocalPlayer/Term.pas

    r10 r12  
    35293529    i: integer;
    35303530  begin
    3531     Mini.free;
    3532     Buffer.free;
    3533     Panel.free;
     3531    TopBar.Free;
     3532    Mini.Free;
     3533    Buffer.Free;
     3534    Panel.Free;
    35343535    for i := 0 to nPl - 1 do
    35353536      if AILogo[i] <> nil then
    3536         AILogo[i].free;
     3537        AILogo[i].Free;
    35373538  end;
    35383539
  • trunk/Start.lfm

    r9 r12  
    11object StartDlg: TStartDlg
    22  Left = 246
     3  Height = 326
    34  Top = 109
     5  Width = 556
    46  BorderIcons = []
    57  BorderStyle = bsNone
     
    810  ClientWidth = 556
    911  Color = clBtnFace
    10   Font.Charset = DEFAULT_CHARSET
    1112  Font.Color = clWindowText
    1213  Font.Height = -13
    1314  Font.Name = 'MS Sans Serif'
    14   Font.Style = []
    1515  FormStyle = fsStayOnTop
    1616  OnClose = FormClose
     
    2424  OnPaint = FormPaint
    2525  OnShow = FormShow
    26   PixelsPerInch = 96
     26  LCLVersion = '1.6.2.0'
    2727  object StartBtn: TButtonA
    2828    Tag = 15104
    2929    Left = 389
     30    Height = 25
    3031    Top = 286
    3132    Width = 100
    32     Height = 25
    3333    Down = False
    3434    Permanent = False
    3535    OnClick = StartBtnClick
    36     Caption = ''
    3736  end
    3837  object Down1Btn: TButtonC
    3938    Tag = 4096
    4039    Left = 522
     40    Height = 12
    4141    Top = 111
    4242    Width = 12
    43     Height = 12
    4443    Down = False
    4544    Permanent = False
     
    5049    Tag = 4096
    5150    Left = 522
     51    Height = 12
    5252    Top = 99
    5353    Width = 12
    54     Height = 12
    5554    Down = False
    5655    Permanent = False
     
    6160    Tag = 10240
    6261    Left = 412
     62    Height = 25
    6363    Top = 98
    6464    Width = 25
    65     Height = 25
    6665    Visible = False
    6766    Down = False
     
    7372    Tag = 10240
    7473    Left = 441
     74    Height = 25
    7575    Top = 98
    7676    Width = 25
    77     Height = 25
    7877    Visible = False
    7978    Down = False
     
    8584    Tag = 6912
    8685    Left = 522
     86    Height = 12
    8787    Top = 249
    8888    Width = 12
    89     Height = 12
    9089    Visible = False
    9190    Down = False
     
    9796    Tag = 6912
    9897    Left = 522
     98    Height = 12
    9999    Top = 237
    100100    Width = 12
    101     Height = 12
    102101    Visible = False
    103102    Down = False
     
    109108    Tag = 268435200
    110109    Left = 530
     110    Height = 25
    111111    Top = 7
    112112    Width = 25
    113     Height = 25
    114113    Down = False
    115114    Permanent = False
     
    120119    Tag = 768
    121120    Left = 120
     121    Height = 12
    122122    Top = 302
    123123    Width = 12
    124     Height = 12
    125124    Down = False
    126125    Permanent = False
     
    130129  object AutoDiffUpBtn: TButtonC
    131130    Left = 280
     131    Height = 12
    132132    Top = 237
    133133    Width = 12
    134     Height = 12
    135134    Down = False
    136135    Permanent = False
     
    140139  object AutoDiffDownBtn: TButtonC
    141140    Left = 280
     141    Height = 12
    142142    Top = 249
    143143    Width = 12
    144     Height = 12
    145144    Down = False
    146145    Permanent = False
     
    150149  object AutoEnemyUpBtn: TButtonC
    151150    Left = 206
     151    Height = 12
    152152    Top = 152
    153153    Width = 12
    154     Height = 12
    155154    Down = False
    156155    Permanent = False
     
    160159  object AutoEnemyDownBtn: TButtonC
    161160    Left = 206
     161    Height = 12
    162162    Top = 164
    163163    Width = 12
    164     Height = 12
    165164    Down = False
    166165    Permanent = False
     
    171170    Tag = 2048
    172171    Left = 352
     172    Height = 25
    173173    Top = 286
    174174    Width = 25
    175     Height = 25
    176175    Down = False
    177176    Permanent = False
     
    182181    Tag = 15360
    183182    Left = 45
     183    Height = 238
    184184    Top = 64
    185185    Width = 266
    186     Height = 238
    187     TabStop = False
    188186    BorderStyle = bsNone
    189187    Color = clBlack
    190188    ExtendedSelect = False
    191     Font.Charset = DEFAULT_CHARSET
    192189    Font.Color = 4176863
    193190    Font.Height = -15
     
    195192    Font.Style = [fsBold]
    196193    IntegralHeight = True
    197     ItemHeight = 17
     194    ItemHeight = 0
     195    OnClick = ListClick
    198196    ParentFont = False
    199197    TabOrder = 0
    200     Visible = False
    201     OnClick = ListClick
     198    TabStop = False
     199    Visible = False
    202200  end
    203201  object PopupMenu1: TPopupMenu
    204     Left = 8
    205     Top = 8
     202    left = 8
     203    top = 8
    206204  end
    207205end
  • trunk/Start.pas

    r9 r12  
    2020
    2121type
     22
     23  { TStartDlg }
     24
    2225  TStartDlg = class(TDrawDlg)
    2326    PopupMenu1: TPopupMenu;
Note: See TracChangeset for help on using the changeset viewer.