mirror of
				https://gitlab.com/freepascal.org/lazarus/lazarus.git
				synced 2025-10-31 03:01:28 +01:00 
			
		
		
		
	openglcontrol: fixed calling ancestor Create/DestroyHandle, bug #16984
git-svn-id: trunk@26779 -
This commit is contained in:
		
							parent
							
								
									3ebbb2a0a9
								
							
						
					
					
						commit
						b18d3e0541
					
				| @ -454,11 +454,10 @@ class function TWSOpenGLControl.CreateHandle(const AWinControl: TWinControl; | |||||||
| var | var | ||||||
|   OpenGlControl: TCustomOpenGLControl; |   OpenGlControl: TCustomOpenGLControl; | ||||||
|   AttrControl: TCustomOpenGLControl; |   AttrControl: TCustomOpenGLControl; | ||||||
|   ParentWidgetClass: TWSLCLComponentClass; |  | ||||||
| begin | begin | ||||||
|   if csDesigning in AWinControl.ComponentState then begin |   if csDesigning in AWinControl.ComponentState then begin | ||||||
|     ParentWidgetClass:=FindWSComponentClass(TWinControl); |     // do not use "inherited CreateHandle", because the LCL changes the hierarchy at run time | ||||||
|     Result:=TWSWinControlClass(ParentWidgetClass).CreateHandle(AWinControl,AParams); |     Result:=TWSWinControlClass(ClassParent).CreateHandle(AWinControl,AParams); | ||||||
|   end |   end | ||||||
|   else begin |   else begin | ||||||
|     OpenGlControl:=AWinControl as TCustomOpenGLControl; |     OpenGlControl:=AWinControl as TCustomOpenGLControl; | ||||||
| @ -474,12 +473,10 @@ begin | |||||||
| end; | end; | ||||||
| 
 | 
 | ||||||
| class procedure TWSOpenGLControl.DestroyHandle(const AWinControl: TWinControl); | class procedure TWSOpenGLControl.DestroyHandle(const AWinControl: TWinControl); | ||||||
| var |  | ||||||
|   ParentWidgetClass: TWSLCLComponentClass; |  | ||||||
| begin | begin | ||||||
|   LOpenGLDestroyContextInfo(AWinControl); |   LOpenGLDestroyContextInfo(AWinControl); | ||||||
|   ParentWidgetClass:=FindWSComponentClass(TWinControl); |   // do not use "inherited DestroyHandle", because the LCL changes the hierarchy at run time | ||||||
|   TWSWinControlClass(ParentWidgetClass).DestroyHandle(AWinControl); |   TWSWinControlClass(ClassParent).DestroyHandle(AWinControl); | ||||||
| end; | end; | ||||||
| 
 | 
 | ||||||
| initialization | initialization | ||||||
|  | |||||||
		Loading…
	
		Reference in New Issue
	
	Block a user
	 mattias
						mattias