lcl-db: prevent lookup initialization when dataset is destroyed

git-svn-id: trunk@37154 -
This commit is contained in:
marc 2012-05-04 12:27:30 +00:00
parent 465eb5f5c1
commit 09e587db69

View File

@ -171,14 +171,18 @@ procedure TDBLookupComboBox.UpdateLookup;
var
i: Integer;
begin
if ([csLoading, csDestroying] * ComponentState) = [] then
begin
if ([csLoading, csDestroying] * ComponentState) <> [] then Exit;
if FDataLink.Active then
begin;
FLookup.Initialize(FDataLink, Items);
i := FLookup.GetKeyIndex;
ItemIndex := i;
if i = -1 then
Text := '';
end;
end
else i := -1;
ItemIndex := i;
if i = -1 then
Text := '';
end;
procedure TDBLookupComboBox.CloseUp;