Changeset 278


Ignore:
Timestamp:
Feb 14, 2019, 10:25:13 PM (6 years ago)
Author:
chronos
Message:
  • Fixed: Incorrect way to assign units between two game systems causing crash of the application on exit.
Location:
trunk
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/Forms/UFormGameSystem.pas

    r277 r278  
    9898procedure TFormGameSystem.FormDestroy(Sender: TObject);
    9999begin
    100   FormUnitKinds.Free;
     100  GameSystem := nil;
     101  FreeAndNil(FormUnitKinds);
    101102end;
    102103
  • trunk/Forms/UFormGameSystems.lfm

    r275 r278  
    1010  OnClose = FormClose
    1111  OnCreate = FormCreate
     12  OnDestroy = FormDestroy
    1213  OnShow = FormShow
    1314  LCLVersion = '1.8.4.0'
  • trunk/Forms/UFormGameSystems.pas

    r277 r278  
    3838    procedure FormClose(Sender: TObject; var CloseAction: TCloseAction);
    3939    procedure FormCreate(Sender: TObject);
     40    procedure FormDestroy(Sender: TObject);
    4041    procedure FormShow(Sender: TObject);
    4142    procedure ListView1Data(Sender: TObject; Item: TListItem);
     
    159160end;
    160161
     162procedure TFormGameSystems.FormDestroy(Sender: TObject);
     163begin
     164  GameSystems := nil;
     165end;
     166
    161167procedure TFormGameSystems.FormShow(Sender: TObject);
    162168begin
  • trunk/UUnit.pas

    r277 r278  
    3636    procedure SaveToNode(Node: TDOMNode);
    3737    constructor Create(FreeObjects: Boolean = True);
     38    procedure Assign(Source: TUnitKinds);
    3839  end;
    3940
     
    353354end;
    354355
     356procedure TUnitKinds.Assign(Source: TUnitKinds);
     357var
     358  I: Integer;
     359begin
     360  while Count > Source.Count do Delete(Count - 1);
     361  while Count < Source.Count do AddNew('');
     362  for I := 0 to Count - 1 do
     363    Items[I].Assign(Source.Items[I]);
     364end;
     365
    355366end.
    356367
  • trunk/xtactics.lpi

    r277 r278  
    317317        <IsPartOfProject Value="True"/>
    318318        <ComponentName Value="FormUnitKind"/>
     319        <HasResources Value="True"/>
    319320        <ResourceBaseClass Value="Form"/>
    320321      </Unit38>
Note: See TracChangeset for help on using the changeset viewer.