LCL: fixed invalid typecast, breaking option -CR

git-svn-id: trunk@53175 -
This commit is contained in:
mattias 2016-10-20 09:17:04 +00:00
parent f0b6a63446
commit 1d83009108

View File

@ -5255,7 +5255,7 @@ end;
procedure TWinControl.DestroyHandle;
var
i: integer;
AWinControl: TWinControl;
AControl: TControl;
begin
//DebugLn(['TWinControl.DestroyHandle START ',DbgSName(Self)]);
if not HandleAllocated then begin
@ -5270,9 +5270,9 @@ begin
if FControls <> nil then begin
for i:= 0 to FControls.Count - 1 do begin
//DebugLn([' ',i,' ',DbgSName(TObject(FWinControls[i]))]);
AWinControl:=TWinControl(FControls[i]);
if (AWinControl is TWinControl) and AWinControl.HandleAllocated then
AWinControl.DestroyHandle;
AControl:=TControl(FControls[i]);
if (AControl is TWinControl) and TWinControl(AControl).HandleAllocated then
TWinControl(AControl).DestroyHandle;
end;
end;
//DebugLn(['TWinControl.DestroyHandle DESTROY SELF ',DbgSName(Self)]);