mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-12-05 05:27:19 +01:00
* Patch from Luiz Americo for some cleanup (bug ID 22550)
git-svn-id: trunk@22600 -
This commit is contained in:
parent
d0fbfe4525
commit
74149ab196
@ -1067,7 +1067,7 @@ type
|
||||
Tfields = Class(TObject)
|
||||
Private
|
||||
FDataset : TDataset;
|
||||
FFieldList : TList;
|
||||
FFieldList : TFpList;
|
||||
FOnChange : TNotifyEvent;
|
||||
FValidFieldKinds : TFieldKinds;
|
||||
Protected
|
||||
|
||||
@ -3135,14 +3135,14 @@ Constructor TFields.Create(ADataset : TDataset);
|
||||
|
||||
begin
|
||||
FDataSet:=ADataset;
|
||||
FFieldList:=TList.Create;
|
||||
FFieldList:=TFpList.Create;
|
||||
FValidFieldKinds:=[fkData..fkInternalcalc];
|
||||
end;
|
||||
|
||||
Destructor TFields.Destroy;
|
||||
|
||||
begin
|
||||
if FFieldList <> nil then Clear;
|
||||
Clear;
|
||||
FFieldList.Free;
|
||||
inherited Destroy;
|
||||
end;
|
||||
@ -3235,13 +3235,15 @@ begin
|
||||
end;
|
||||
|
||||
Procedure TFields.Clear;
|
||||
|
||||
var
|
||||
AField: TField;
|
||||
begin
|
||||
with FFieldList do
|
||||
while Count > 0 do begin
|
||||
TField(Last).FDataSet := Nil;
|
||||
TField(Last).Free;
|
||||
FFieldList.Delete(Count - 1);
|
||||
while FFieldList.Count > 0 do
|
||||
begin
|
||||
AField := TField(FFieldList.Last);
|
||||
AField.FDataSet := Nil;
|
||||
AField.Free;
|
||||
FFieldList.Delete(FFieldList.Count - 1);
|
||||
end;
|
||||
Changed;
|
||||
end;
|
||||
|
||||
Loading…
Reference in New Issue
Block a user