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