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 var
i: Integer; i: Integer;
begin begin
if ([csLoading, csDestroying] * ComponentState) = [] then if ([csLoading, csDestroying] * ComponentState) <> [] then Exit;
begin
if FDataLink.Active then
begin;
FLookup.Initialize(FDataLink, Items); FLookup.Initialize(FDataLink, Items);
i := FLookup.GetKeyIndex; i := FLookup.GetKeyIndex;
end
else i := -1;
ItemIndex := i; ItemIndex := i;
if i = -1 then if i = -1 then
Text := ''; Text := '';
end;
end; end;
procedure TDBLookupComboBox.CloseUp; procedure TDBLookupComboBox.CloseUp;