LCL: do not call SetImageListWS if handle is not allocated. Issue #36921

git-svn-id: trunk@62999 -
This commit is contained in:
ondrej 2020-04-16 13:21:33 +00:00
parent 645dbc3676
commit d0ac09f35b

View File

@ -1604,7 +1604,6 @@ begin
FImages[lvil].FreeNotification(self);
end;
if not HandleAllocated then Exit;
SetImageListWS(lvil);
end;
@ -1624,7 +1623,6 @@ begin
FImagesWidth[lvil] := AValue;
if not HandleAllocated then Exit;
SetImageListWS(lvil);
end;
@ -1632,6 +1630,8 @@ procedure TCustomListView.SetImageListWS(const ALvil: TListViewImageList);
var
R: TCustomImageListResolution;
begin
if not HandleAllocated then
Exit;
if FImages[ALvil]<>nil then
R := FImages[ALvil].ResolutionForPPI[FImagesWidth[ALvil], Font.PixelsPerInch, 1].Resolution // to-do: support scaling factor
else