(!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 */
 | 
					#endif /* XINERAMA */
 | 
				
			||||||
 | 
					
 | 
				
			||||||
typedef struct _ShmScrPrivateRec {
 | 
					typedef struct _ShmScrPrivateRec {
 | 
				
			||||||
    CloseScreenProcPtr CloseScreen;
 | 
					 | 
				
			||||||
    ShmFuncsPtr shmFuncs;
 | 
					    ShmFuncsPtr shmFuncs;
 | 
				
			||||||
    DestroyPixmapProcPtr destroyPixmap;
 | 
					    DestroyPixmapProcPtr destroyPixmap;
 | 
				
			||||||
} ShmScrPrivateRec;
 | 
					} ShmScrPrivateRec;
 | 
				
			||||||
| 
						 | 
					@ -194,15 +193,13 @@ CheckForShmSyscall(void)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
#endif
 | 
					#endif
 | 
				
			||||||
 | 
					
 | 
				
			||||||
static Bool
 | 
					static void
 | 
				
			||||||
ShmCloseScreen(ScreenPtr pScreen)
 | 
					ShmScreenClose(ScreenPtr pScreen, void *arg)
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
    ShmScrPrivateRec *screen_priv = ShmGetScreenPriv(pScreen);
 | 
					    ShmScrPrivateRec *screen_priv = ShmGetScreenPriv(pScreen);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    pScreen->CloseScreen = screen_priv->CloseScreen;
 | 
					 | 
				
			||||||
    dixSetPrivate(&pScreen->devPrivates, shmScrPrivateKey, NULL);
 | 
					    dixSetPrivate(&pScreen->devPrivates, shmScrPrivateKey, NULL);
 | 
				
			||||||
    free(screen_priv);
 | 
					    free(screen_priv);
 | 
				
			||||||
    return (*pScreen->CloseScreen) (pScreen);
 | 
					 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
static ShmScrPrivateRec *
 | 
					static ShmScrPrivateRec *
 | 
				
			||||||
| 
						 | 
					@ -212,9 +209,8 @@ ShmInitScreenPriv(ScreenPtr pScreen)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    if (!screen_priv) {
 | 
					    if (!screen_priv) {
 | 
				
			||||||
        screen_priv = calloc(1, sizeof(ShmScrPrivateRec));
 | 
					        screen_priv = calloc(1, sizeof(ShmScrPrivateRec));
 | 
				
			||||||
        screen_priv->CloseScreen = pScreen->CloseScreen;
 | 
					 | 
				
			||||||
        dixSetPrivate(&pScreen->devPrivates, shmScrPrivateKey, screen_priv);
 | 
					        dixSetPrivate(&pScreen->devPrivates, shmScrPrivateKey, screen_priv);
 | 
				
			||||||
        pScreen->CloseScreen = ShmCloseScreen;
 | 
					        dixScreenHookClose(pScreen, ShmScreenClose, NULL);
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
    return screen_priv;
 | 
					    return screen_priv;
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
		Reference in New Issue