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