LCL: Windows, protect wincontrol via Inc/DecLclRefCount while in DoWindProc / see issue #0028404 / see rev 63507 #d031209b99

git-svn-id: trunk@63529 -
This commit is contained in:
martin 2020-07-08 13:28:32 +00:00
parent 1ef7418a6d
commit 4fd90b6fad

View File

@ -528,13 +528,17 @@ end;
procedure TWindowProcHelper.SetlWinControl(AValue: TWinControl);
begin
if FlWinControl = AValue then Exit;
if FlWinControl <> nil then
if FlWinControl <> nil then begin
FlWinControl.DecLCLRefCount;
FlWinControl.RemoveHandlerOnBeforeDestruction(@TWindProcNotificationReceiver(@Self).ReceiveDestroyNotify);
end;
FlWinControl := AValue;
if FlWinControl <> nil then
if FlWinControl <> nil then begin
FlWinControl.AddHandlerOnBeforeDestruction(@TWindProcNotificationReceiver(@Self).ReceiveDestroyNotify);
FlWinControl.IncLCLRefCount;
end;
end;
procedure TWindowProcHelper.CalcClipRgn(PaintRegion: HRGN);