From ad3e1137d99ae49c88c1a5d6b0abbddebaa5db7a Mon Sep 17 00:00:00 2001 From: maxim Date: Tue, 19 Jul 2016 22:21:24 +0000 Subject: [PATCH] Merged revision(s) 52703 #a55241308e from trunk: revert r52494, r52500 #48fe37a204: they caused crashes in Carbon interface. Issue #30003 ........ git-svn-id: branches/fixes_1_6@52721 - --- lcl/controls.pp | 1 - lcl/include/controlcanvas.inc | 9 +-------- lcl/include/wincontrol.inc | 9 --------- 3 files changed, 1 insertion(+), 18 deletions(-) diff --git a/lcl/controls.pp b/lcl/controls.pp index 2f4c616930..12da9243d1 100644 --- a/lcl/controls.pp +++ b/lcl/controls.pp @@ -297,7 +297,6 @@ type FWindowHandle: HWND; procedure SetControl(AControl: TControl); protected - procedure SetHandle(NewHandle: HDC); override; procedure CreateHandle; override; function GetDefaultColor(const ADefaultColorType: TDefaultColorType): TColor; override; public diff --git a/lcl/include/controlcanvas.inc b/lcl/include/controlcanvas.inc index aec61f1f0e..da60a2fb66 100644 --- a/lcl/include/controlcanvas.inc +++ b/lcl/include/controlcanvas.inc @@ -27,13 +27,6 @@ begin end; end; -procedure TControlCanvas.SetHandle(NewHandle: HDC); -begin - if NewHandle=0 then // don't allow to clear handle if there's valid FDeviceContext - otherwise it doesn't get freed! - NewHandle := FDeviceContext; - inherited SetHandle(NewHandle); -end; - function TControlCanvas.GetDefaultColor(const ADefaultColorType: TDefaultColorType): TColor; begin if Assigned(FControl) then @@ -119,12 +112,12 @@ end; ------------------------------------------------------------------------------} procedure TControlCanvas.FreeHandle; begin + inherited; if FDeviceContext <> 0 then begin ReleaseDC(FWindowHandle, FDeviceContext); FDeviceContext := 0; end; - inherited; end; function TControlCanvas.ControlIsPainting: boolean; diff --git a/lcl/include/wincontrol.inc b/lcl/include/wincontrol.inc index 9bda98c9c7..2c9742fbd7 100644 --- a/lcl/include/wincontrol.inc +++ b/lcl/include/wincontrol.inc @@ -6310,7 +6310,6 @@ end; procedure TWinControl.RemoveControl(AControl: TControl); var AWinControl: TWinControl; - AGrControl: TGraphicControl; begin DisableAutoSizing{$IFDEF DebugDisableAutoSizing}('TWinControl.RemoveControl'){$ENDIF}; try @@ -6323,16 +6322,8 @@ begin AWinControl.DestroyHandle; end else - begin - if AControl is TGraphicControl then - begin - AGrControl := TGraphicControl(AControl); - if (AGrControl.Canvas<>nil) and AGrControl.Canvas.HandleAllocated then - TControlCanvas(AGrControl.Canvas).FreeHandle; - end; if HandleAllocated then AControl.InvalidateControl(AControl.IsVisible, False, True); - end; Remove(AControl); Perform(CM_CONTROLLISTCHANGE, WParam(AControl), LParam(False)); if not (csDestroying in ComponentState) then