(!1714) Xext: shm: use CloseScreen hook
Wrapping ScreenRec's function pointers is problematic for many reasons, so use the new screen close notify hook instead. Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
This commit is contained in:
		
							parent
							
								
									11b536415c
								
							
						
					
					
						commit
						6b6dd29921
					
				
							
								
								
									
										10
									
								
								Xext/shm.c
								
								
								
								
							
							
						
						
									
										10
									
								
								Xext/shm.c
								
								
								
								
							|  | @ -95,7 +95,6 @@ in this Software without prior written authorization from The Open Group. | |||
| #endif /* XINERAMA */ | ||||
| 
 | ||||
| typedef struct _ShmScrPrivateRec { | ||||
|     CloseScreenProcPtr CloseScreen; | ||||
|     ShmFuncsPtr shmFuncs; | ||||
|     DestroyPixmapProcPtr destroyPixmap; | ||||
| } ShmScrPrivateRec; | ||||
|  | @ -194,15 +193,13 @@ CheckForShmSyscall(void) | |||
| 
 | ||||
| #endif | ||||
| 
 | ||||
| static Bool | ||||
| ShmCloseScreen(ScreenPtr pScreen) | ||||
| static void | ||||
| ShmScreenClose(ScreenPtr pScreen, void *arg) | ||||
| { | ||||
|     ShmScrPrivateRec *screen_priv = ShmGetScreenPriv(pScreen); | ||||
| 
 | ||||
|     pScreen->CloseScreen = screen_priv->CloseScreen; | ||||
|     dixSetPrivate(&pScreen->devPrivates, shmScrPrivateKey, NULL); | ||||
|     free(screen_priv); | ||||
|     return (*pScreen->CloseScreen) (pScreen); | ||||
| } | ||||
| 
 | ||||
| static ShmScrPrivateRec * | ||||
|  | @ -212,9 +209,8 @@ ShmInitScreenPriv(ScreenPtr pScreen) | |||
| 
 | ||||
|     if (!screen_priv) { | ||||
|         screen_priv = calloc(1, sizeof(ShmScrPrivateRec)); | ||||
|         screen_priv->CloseScreen = pScreen->CloseScreen; | ||||
|         dixSetPrivate(&pScreen->devPrivates, shmScrPrivateKey, screen_priv); | ||||
|         pScreen->CloseScreen = ShmCloseScreen; | ||||
|         dixScreenHookClose(pScreen, ShmScreenClose, NULL); | ||||
|     } | ||||
|     return screen_priv; | ||||
| } | ||||
|  |  | |||
		Loading…
	
		Reference in New Issue