- Fixed memory leak in TfrmFilter (not freeing FCheckedHues)

- Fixed memory leak in TfrmMain (not freeing the strings in the location info nodes)
- Rearranged frmEditAccount to allow region handling
- Added region handling to the client side account specific network packets
- Fixed some more code style inconsistencies in UfrmRegionControl.pas
- Fixed redrawing in TfrmRegionControl
- Fixed memory leak in TAccount (not freeing FRegions)
- Fixed the TModifyRegionResponsePacket ID
- Fixed the content of the TUserListPacket to not contain the list of all regions
This commit is contained in:
2008-08-17 20:12:36 +02:00
parent c7d845997e
commit d5069bbb50
17 changed files with 570 additions and 419 deletions
+12 -5
View File
@@ -32,7 +32,7 @@ interface
uses
Classes, SysUtils, md5, contnrs, math, DOM, UXmlHelper, UInterfaces,
UEnums, URegions;
type
{ TAccount }
@@ -41,6 +41,7 @@ type
constructor Create(AOwner: IInvalidate; AName, APasswordHash: string;
AAccessLevel: TAccessLevel; ARegions: TStringList);
constructor Deserialize(AOwner: IInvalidate; AElement: TDOMElement);
destructor Destroy; override;
procedure Serialize(AElement: TDOMElement);
protected
FOwner: IInvalidate;
@@ -60,7 +61,7 @@ type
property Regions: TStringList read FRegions;
procedure Invalidate;
end;
{ TAccountList }
TAccountList = class(TObjectList, ISerializable, IInvalidate)
@@ -113,7 +114,7 @@ begin
FLastPos := Point(0, 0);
TXmlHelper.ReadCoords(AElement, 'LastPos', FLastPos.X, FLastPos.Y);
FRegions := TStringList.Create;
xmlElement := TDOMElement(AElement.FindNode('Regions'));
if xmlElement <> nil then
begin
@@ -131,6 +132,12 @@ begin
end;
end;
destructor TAccount.Destroy;
begin
if FRegions <> nil then FreeAndNil(FRegions);
inherited Destroy;
end;
procedure TAccount.SetAccessLevel(const AValue: TAccessLevel);
begin
FAccessLevel := AValue;
@@ -157,8 +164,8 @@ end;
procedure TAccount.Serialize(AElement: TDOMElement);
var
i : Integer;
child : TDOMElement;
i: Integer;
child: TDOMElement;
begin
TXmlHelper.WriteString(AElement, 'Name', FName);
TXmlHelper.WriteString(AElement, 'PasswordHash', FPasswordHash);