mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-06-07 10:38:17 +02:00
lcl-db: prevent lookup initialization when dataset is destroyed
git-svn-id: trunk@37154 -
This commit is contained in:
parent
465eb5f5c1
commit
09e587db69
@ -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;
|
||||||
|
Loading…
Reference in New Issue
Block a user