Fixed: OwnsObject property and constructor parameter for ObjectHash
This commit is contained in:
parent
9abc76272c
commit
f92c475873
@ -1134,7 +1134,7 @@ end;
|
|||||||
{========================= TX2ObjectBTree
|
{========================= TX2ObjectBTree
|
||||||
Item Management
|
Item Management
|
||||||
========================================}
|
========================================}
|
||||||
constructor TX2ObjectBTree.Create;
|
constructor TX2ObjectBTree.Create();
|
||||||
begin
|
begin
|
||||||
inherited;
|
inherited;
|
||||||
|
|
||||||
|
@ -166,12 +166,19 @@ type
|
|||||||
protected
|
protected
|
||||||
procedure FreeHashItem(var AItem: PX2HashItem); override;
|
procedure FreeHashItem(var AItem: PX2HashItem); override;
|
||||||
public
|
public
|
||||||
|
constructor Create(); overload; override;
|
||||||
|
constructor Create(AOwnsObjects: Boolean); reintroduce; overload;
|
||||||
|
|
||||||
//:$ Gets or sets an item.
|
//:$ Gets or sets an item.
|
||||||
property Items[Key: String]: TObject read GetItem
|
property Items[Key: String]: TObject read GetItem
|
||||||
write SetItem; default;
|
write SetItem; default;
|
||||||
|
|
||||||
//:$ Returns the value at the current cursor location.
|
//:$ Returns the value at the current cursor location.
|
||||||
property CurrentValue: TObject read GetCurrentValue;
|
property CurrentValue: TObject read GetCurrentValue;
|
||||||
|
|
||||||
|
//:$ Determines if objects are destroyed when they are removed
|
||||||
|
property OwnsObjects: Boolean read FOwnsObjects
|
||||||
|
write FOwnsObjects;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
implementation
|
implementation
|
||||||
@ -599,6 +606,21 @@ end;
|
|||||||
{========================== TX2ObjectHash
|
{========================== TX2ObjectHash
|
||||||
Item Management
|
Item Management
|
||||||
========================================}
|
========================================}
|
||||||
|
constructor TX2ObjectHash.Create();
|
||||||
|
begin
|
||||||
|
inherited;
|
||||||
|
|
||||||
|
FOwnsObjects := False;
|
||||||
|
end;
|
||||||
|
|
||||||
|
constructor TX2ObjectHash.Create(AOwnsObjects: Boolean);
|
||||||
|
begin
|
||||||
|
inherited Create();
|
||||||
|
|
||||||
|
FOwnsObjects := AOwnsObjects;
|
||||||
|
end;
|
||||||
|
|
||||||
|
|
||||||
function TX2ObjectHash.GetItem;
|
function TX2ObjectHash.GetItem;
|
||||||
begin
|
begin
|
||||||
Result := TObject(inherited GetItem(Key));
|
Result := TObject(inherited GetItem(Key));
|
||||||
|
Loading…
Reference in New Issue
Block a user