Changeset 9


Ignore:
Timestamp:
Feb 11, 2008, 10:27:49 AM (17 years ago)
Author:
george
Message:

Opraveno: Některé neuvolňované pamětové struktury.
Opraveno: Chyba při ukončování a uvolňování paměti.

Location:
trunk
Files:
6 added
11 edited

Legend:

Unmodified
Added
Removed
  • trunk

    • Property svn:ignore set to
      *.dcu
      *.exe
      *.identcache
      *.dsk
      *.~dsk
      Network.cfg
  • trunk/SunriseChat.dpr

    r2 r9  
    2222
    2323begin
     24  ReportMemoryLeaksOnShutdown := DebugHook <> 0;
    2425  Application.Initialize;
    2526  Application.CreateForm(TLocalization, Localization);
  • trunk/SunriseChatCoreUnit.pas

    r2 r9  
    33interface
    44
    5 uses
     5uses                                                                       
    66  SysUtils, WinTypes, WinProcs, Messages, Classes, Graphics, Controls,
    77  Forms, StdCtrls, ExtCtrls, SunriseChatCoreUtils, DateUtils, Dialogs;
     
    235235begin
    236236  Active := False;
    237   for I := 0 to UserList.Count-1 do TList(UserList[I]).Free;
     237  for I := 0 to UserList.Count - 1 do TList(UserList[I]).Free;
    238238  UserList.Free;
    239239  LocalUser.Free;
    240   for I := 0 to RoomList.Count-1 do TRoom(RoomList[I]).Free;
     240  for I := 0 to RoomList.Count - 1 do TRoom(RoomList[I]).Free;
    241241  RoomList.Free;
    242242  inherited;
     
    502502  except
    503503  end;
     504  SourceUser.Free;
     505  TargetUSer.Free;
    504506end;
    505507
  • trunk/SunriseChatNetworkCoreUnit.pas

    r2 r9  
    109109
    110110destructor TSunriseChatNetworkCore.Destroy;
    111 begin
     111var
     112  I: Integer;
     113begin
     114  fndTCPClient1.OnClose := nil;
    112115  Active := False;
     116  for I := 0 to NetworkInterfaces.Count - 1 do
     117    TNetworkInterface(NetworkInterfaces[I]).Free;
    113118  NetworkInterfaces.Free;
    114119  inherited;
  • trunk/ULocalization.dfm

    r2 r9  
    22  OldCreateOrder = False
    33  OnCreate = DataModuleCreate
    4   Left = 504
    5   Top = 303
     4  OnDestroy = DataModuleDestroy
    65  Height = 150
    76  Width = 215
  • trunk/ULocalization.pas

    r2 r9  
    1010    Items: TStringList;
    1111    Name: string;
     12    constructor Create;
     13    destructor Destroy;
    1214  end;
    1315
    1416  TLocalization = class(TDataModule)
    1517    procedure DataModuleCreate(Sender: TObject);
     18    procedure DataModuleDestroy(Sender: TObject);
    1619  public
    1720    ActiveLanguage: Integer;
     
    5962      try
    6063        Name := ReadString('Info', 'Language', 'None');
    61         Items := TStringList.Create;
    6264        ReadSectionValues('Main',Items);
    6365      finally
     
    9597end;
    9698
     99procedure TLocalization.DataModuleDestroy(Sender: TObject);
     100var
     101  I: Integer;
     102begin
     103  for I := 0 to High(Languages) do
     104    Languages[I].Free;   
     105end;
     106
     107{ TLanguage }
     108
     109constructor TLanguage.Create;
     110begin
     111  Items := TStringList.Create;
     112end;
     113
     114destructor TLanguage.Destroy;
     115begin
     116  Items.Free;
     117end;
     118
    97119end.
  • trunk/ULogExceptions.pas

    r2 r9  
    231231procedure TLogExceptions.FormDestroy(Sender: TObject);
    232232begin
     233  FreeAndNil(StoreError);
    233234  FreeAndNil(FMapFile);
    234235end;
  • trunk/UMainWindow.dfm

    r2 r9  
    22  Left = 519
    33  Top = 296
    4   Width = 478
    5   Height = 385
    64  Caption = 'SunriseChat'
     5  ClientHeight = 331
     6  ClientWidth = 470
    77  Color = clBtnFace
    88  Constraints.MinHeight = 100
     
    9393      object ToolBar1: TToolBar
    9494        Left = 0
    95         Top = 143
     95        Top = 147
    9696        Width = 26
    97         Height = 158
     97        Height = 154
    9898        Align = alBottom
    9999        AutoSize = True
     
    104104        TabOrder = 0
    105105        Transparent = False
     106        ExplicitTop = 143
    106107        object ToolButton1: TToolButton
    107108          Left = 0
    108           Top = 2
     109          Top = 0
    109110          Hint = 'Neposouvat text'
    110111          Caption = 'ToolButton1'
     
    116117        object ToolButton2: TToolButton
    117118          Left = 0
    118           Top = 24
     119          Top = 22
    119120          Hint = 'Informace'
    120121          Caption = 'ToolButton2'
     
    125126        object ToolButton3: TToolButton
    126127          Left = 0
    127           Top = 46
     128          Top = 44
    128129          Hint = 'Nastaven'#237
    129130          Caption = 'ToolButton3'
     
    134135        object ToolButton4: TToolButton
    135136          Left = 0
    136           Top = 68
     137          Top = 66
    137138          Hint = 'Vypnout zvuk'
    138139          Caption = 'ToolButton4'
     
    144145        object ToolButton5: TToolButton
    145146          Left = 0
    146           Top = 90
     147          Top = 88
    147148          Hint = 'V'#382'dy navrchu'
    148149          Caption = 'ToolButton5'
     
    154155        object ToolButton7: TToolButton
    155156          Left = 0
    156           Top = 112
     157          Top = 110
    157158          Hint = 'Minimalizovat'
    158159          Caption = 'ToolButton7'
     
    163164        object ToolButton6: TToolButton
    164165          Left = 0
    165           Top = 134
     166          Top = 132
    166167          Hint = 'Vypnut'#237' obr'#225'zk'#367
    167168          Caption = 'ToolButton6'
     
    195196        Top = 20
    196197        Width = 116
    197         Height = 280
     198        Height = 260
    198199        Hint = 'Seznam online u'#382'ivatel'#367
    199200        Anchors = [akLeft, akTop, akRight, akBottom]
     
    244245        Top = 0
    245246        Width = 316
    246         Height = 229
     247        Height = 209
    247248        ActivePage = TabSheet1
    248249        Anchors = [akLeft, akTop, akRight, akBottom]
     
    272273        Top = 20
    273274        Width = 316
    274         Height = 280
     275        Height = 260
    275276        Anchors = [akLeft, akTop, akRight, akBottom]
    276277        BevelOuter = bvNone
     
    284285          Top = 0
    285286          Width = 316
    286           Height = 280
     287          Height = 260
    287288          Align = alClient
    288289          Columns = <>
     
    521522    CycleInterval = 0
    522523    Icon.Data = {
    523       0000010001001010040000000000280100001600000028000000100000002000
    524       0000010004000000000080000000000000000000000000000000000000000000
    525       000000008000008000000080800080000000800080008080000080808000C0C0
    526       C0000000FF0000FF000000FFFF00FF000000FF00FF00FFFF0000FFFFFF000000
    527       00000000000000000887088700000000000000000000000000CC4CC000000000
    528       00CC4CC00000000080CCCCC0800000000000000000000000A222222220000000
    529       A2AAAA2220000000A2AA222220000000AAA0002A200000000008880000000000
    530       000888000000000000088800000000000008880000000000000000000000F007
     524      0000010001001010200000000000680400001600000028000000100000002000
     525      0000010020000000000000040000000000000000000000000000000000000000
     526      0000000000000000000000000000000000000000000000000000000000000000
     527      0000000000000000000000000000000000000000000000000000000000000000
     528      000000000000000000000000000000000000CECECE00CECECE009C9C9C000000
     529      0000CECECE00CECECE0063636300000000000000000000000000000000000000
     530      0000000000000000000000000000000000000000000000000000000000000000
     531      0000000000000000000000000000000000000000000000000000000000000000
     532      00000000000000000000000000000000000000000000FF522100FF2121009431
     533      0000FF522100FF21210000000000000000000000000000000000000000000000
     534      00000000000000000000000000000000000000000000FF522100FF2121009431
     535      0000FF522100FF21210000000000000000000000000000000000000000000000
     536      00000000000000000000000000008CD6FF0000000000FF522100FF522100FF52
     537      2100FF522100FF212100000000008CD6FF000000000000000000000000000000
     538      0000000000000000000000000000000000000000000000000000000000000000
     539      0000000000000000000000000000000000000000000000000000000000000000
     540      000000000000000000000000000000DE00000073000000940000009400000094
     541      0000009400000094000000730000009400000000000000000000000000000000
     542      000000000000000000000000000000DE00000073000000DE000000DE000000DE
     543      000000DE00000094000000730000009400000000000000000000000000000000
     544      000000000000000000000000000000DE00000073000000DE000000DE00000094
     545      0000009400000094000000730000009400000000000000000000000000000000
     546      000000000000000000000000000000DE000000DE000000DE0000000000000000
     547      0000000000000094000000DE0000009400000000000000000000000000000000
     548      00000000000000000000000000000000000000000000000000006B8CFF006B8C
     549      FF006B8CFF000000000000000000000000000000000000000000000000000000
     550      00000000000000000000000000000000000000000000000000008CD6FF008CD6
     551      FF006B8CFF000000000000000000000000000000000000000000000000000000
     552      00000000000000000000000000000000000000000000000000008CD6FF008CD6
     553      FF006B8CFF000000000000000000000000000000000000000000000000000000
     554      00000000000000000000000000000000000000000000000000008CD6FF008CD6
     555      FF006B8CFF000000000000000000000000000000000000000000000000000000
     556      0000000000000000000000000000000000000000000000000000000000000000
     557      000000000000000000000000000000000000000000000000000000000000F007
    531558      0000F0070000F80F0000F80F0000F0070000E0030000E0030000E0030000E003
    532559      0000E0030000E0030000F0070000FC1F0000FC1F0000FC1F0000FE3F0000}
     
    19711998    Top = 80
    19721999  end
    1973   object SunriseChatNetworkCore1: TSunriseChatNetworkCore
    1974     AutoAwayDelay = 5
    1975     UseDefaultEventsText = True
    1976     Active = False
    1977     MaxRoomLines = 100
    1978     OnUserListUpdate = SunriseChatNetworkCore1UserListUpdate
    1979     OnAddMessage = SunriseChatNetworkCore1AddMessage
    1980     OnRoomListChanged = SunriseChatNetworkCore1RoomListChanged
    1981     BroadcastType = btLocal
    1982     UdpPort = 55557
    1983     Left = 180
    1984     Top = 84
    1985   end
    19862000end
  • trunk/UMainWindow.pas

    r2 r9  
    177177    Vloitsovodkaz1: TMenuItem;
    178178    OpenDialog1: TOpenDialog;
    179     SunriseChatNetworkCore1: TSunriseChatNetworkCore;
     179    procedure FormCreate(Sender: TObject);
    180180    procedure Vloitsovodkaz1Click(Sender: TObject);
    181181    procedure RichView1Jump(Sender: TObject; id: Integer);
    182182    procedure Vloit1Click(Sender: TObject);
    183183    procedure Koprovar1Click(Sender: TObject);
    184     procedure FormCreate(Sender: TObject);
    185184    procedure Button1Click(Sender: TObject);
    186185    procedure FormShow(Sender: TObject);
     
    250249    { Private declarations }
    251250  public
     251    SunriseChatNetworkCore1: TSunriseChatNEtworkCore;
    252252    UserEventsImagesEnabled: Boolean;
    253253    FirstStart: Boolean;
     
    391391  I: Integer;
    392392begin
     393  SunriseChatNetworkCore1 := TSunriseChatNetworkCore.Create(Self);
     394  with SunriseChatNetworkCore1 do begin
     395    UdpPort := 55557;
     396    UseDefaultEventsText := True;
     397    AutoAwayDelay := 5;
     398    AutoReconnect := True;
     399    BroadcastType := btLocal;
     400    MaxRoomLines := 100;
     401  end;
     402
    393403  SettingsName := '';
    394404  // Process application parameters
     
    11071117var
    11081118  I: Integer;
    1109   T: TListBox;
     1119//  T: TListBox;
    11101120  NewTabSheet: TTabSheet;
    11111121begin
     
    13491359procedure TMainWindow.AddEvent(Name, Text: string; Options: TEventOptions);
    13501360begin
    1351   SetLength(AppEventsInit,Length(AppEventsInit)+1);
     1361  SetLength(AppEventsInit, Length(AppEventsInit) + 1);
    13521362  with AppEventsInit[High(AppEventsInit)] do begin
    1353     EventName:= Name;
    1354     ShowMessage:= eoShowMessage in Options;
    1355     MessageText:= Text;
    1356     MessageFont:= TFont.Create;
    1357     ShowBalloonHint:= eoShowBalloonHint in Options;
    1358     ShowAlertIcon:= eoShowAlertIcon in Options;
    1359     ShowWindow:= eoShowWindow in Options;
    1360     PlayBeep:= eoPlayBeep in Options;
     1363    EventName := Name;
     1364    ShowMessage := eoShowMessage in Options;
     1365    MessageText := Text;
     1366    MessageFont := TFont.Create;
     1367    ShowBalloonHint := eoShowBalloonHint in Options;
     1368    ShowAlertIcon := eoShowAlertIcon in Options;
     1369    ShowWindow := eoShowWindow in Options;
     1370    PlayBeep := eoPlayBeep in Options;
    13611371  end;
    13621372end;
     
    14081418  for I:= 0 to High(AppEventsOptions) do begin
    14091419    //if not Assigned(AppEventsOptions[I]) then
    1410     AppEventsOptions[I]:= TAutoRegistry.Create(RegistryPath+'\'+SettingsName+'\AppEvents\'+IntToStr(I));
     1420    AppEventsOptions[I] := TAutoRegistry.Create(RegistryPath+'\'+SettingsName+'\AppEvents\'+IntToStr(I));
    14111421    with AppEventsOptions[I], AppEvents[I] do begin
    14121422      Include('ShowWindow',ShowWindow,ShowWindow);
     
    17791789
    17801790procedure TMainWindow.FormDestroy(Sender: TObject);
     1791var
     1792  I: Integer;
    17811793begin
    17821794  UsersAutoAwayDelay := SunriseChatNetworkCore1.AutoAwayDelay;
     
    17961808  SunriseChatNetworkCore1.SendCommand(scDisconnect);
    17971809  Options.Free;
     1810  for I := 0 to High(AppEvents) do
     1811    AppEvents[I].MessageFont.Free;
     1812  for I := 0 to High(AppEventsOptions) do
     1813    AppEventsOptions[I].Free;
    17981814end;
    17991815
    18001816procedure TMainWindow.FormClose(Sender: TObject; var Action: TCloseAction);
    1801 var
    1802   I: Integer;
     1817//var
     1818//  I: Integer;
    18031819begin
    18041820  SunriseChatNetworkCore1.SendCommand(scDisconnect);
  • trunk/UNetworkTest.dfm

    r2 r9  
    22  Left = 295
    33  Top = 207
    4   Width = 475
    5   Height = 264
    64  ActiveControl = ListView1
    75  Caption = 'Test s'#237't'#283
     6  ClientHeight = 230
     7  ClientWidth = 467
    88  Color = clBtnFace
    99  Constraints.MinHeight = 100
     
    1717  Position = poScreenCenter
    1818  OnCreate = FormCreate
     19  OnDestroy = FormDestroy
    1920  OnShow = FormShow
    2021  DesignSize = (
  • trunk/UNetworkTest.pas

    r2 r9  
    2929    procedure SpinEdit1Change(Sender: TObject);
    3030    procedure ComboBox1Change(Sender: TObject);
     31    procedure FormDestroy(Sender: TObject);
    3132  private
    3233    { Private declarations }
     
    6667  Row: string;
    6768
     69const
     70  NetworkFileName = 'Network.cfg';
     71
    6872function Parse: string;
    6973begin
     
    7781    PingList := TPingList.Create(True);
    7882    ChDir(ExtractFileDir(Application.ExeName));
    79     AssignFile(Soubor, 'Network.cfg');
    80     Reset(Soubor);
     83    AssignFile(Soubor, NetworkFileName);
     84    if FileExists(NetworkFileName) then Reset(Soubor) else Rewrite(Soubor);
    8185    SetLength(Devices, 1);
    8286    while not Eof(Soubor) do begin
     
    102106end;
    103107
     108procedure TNetworkTest.FormDestroy(Sender: TObject);
     109begin
     110  PingList.Free;
     111end;
     112
    104113procedure TNetworkTest.FormShow(Sender: TObject);
    105114begin
Note: See TracChangeset for help on using the changeset viewer.