Fix minor memory leak for suspended cached dataset holding collations.

This commit is contained in:
Ansgar Becker
2009-06-12 17:53:16 +00:00
parent 1a39aad6d4
commit d757b579ac

View File

@ -8829,8 +8829,10 @@ end;
function TMainform.GetCollations(Items: TWideStrings = nil): TDataset; function TMainform.GetCollations(Items: TWideStrings = nil): TDataset;
begin begin
// Return cached collation list, used in several places, e.g. table editor // Return cached collation list, used in several places, e.g. table editor
if (dsCollations = nil) or (dsCollations.State = dsInactive) then if (dsCollations = nil) or (dsCollations.State = dsInactive) then begin
FreeAndNil(dsCollations);
dsCollations := GetResults('SHOW COLLATION', True); dsCollations := GetResults('SHOW COLLATION', True);
end;
if Assigned(dsCollations) then begin if Assigned(dsCollations) then begin
dsCollations.First; dsCollations.First;
if Assigned(Items) then begin if Assigned(Items) then begin