From: <ob...@us...> - 2010-06-07 08:34:35
|
Revision: 12790 http://jvcl.svn.sourceforge.net/jvcl/?rev=12790&view=rev Author: obones Date: 2010-06-07 08:34:28 +0000 (Mon, 07 Jun 2010) Log Message: ----------- Mantis 5225: Only work with controls whose handle is allocated Modified Paths: -------------- trunk/jvcl/run/JvDesignSurface.pas Modified: trunk/jvcl/run/JvDesignSurface.pas =================================================================== --- trunk/jvcl/run/JvDesignSurface.pas 2010-06-07 08:26:35 UTC (rev 12789) +++ trunk/jvcl/run/JvDesignSurface.pas 2010-06-07 08:34:28 UTC (rev 12790) @@ -878,12 +878,16 @@ // processed the WM_WINDOWPOSCHANGED message when this code executes. // If we did not, the designer would use the previous position of the // control to display the handles. + // Additionnaly, we must not work with controls that don't have their + // handle allocated. In some instances, creating the handle may trigger + // a second WM_WINDOWPOSCHANGED message, thus leading to an infinite + // loop and a crash (Mantis 5225) for I := 0 to Container.ComponentCount - 1 do begin if Container.Components[I] is TWinControl then begin Control := TAccessWinControl(Container.Components[I]); - if PosChangedHandle = Control.Handle then + if Control.HandleAllocated and (PosChangedHandle = Control.Handle) then begin if not (csDestroyingHandle in Control.ControlState) then {$IFDEF DELPHI10_UP} This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |