mirror of
https://github.com/X11Libre/xserver.git
synced 2026-01-26 14:03:17 +00:00
shm: Don't mark the globally-initialized privates as uninitialized in a CloseScreen hook.
No need to mark anything, because duplicate dixRegisterPrivateKey() calls with same parameters are perfectly valid. See: https://github.com/X11Libre/xserver/pull/1300 Fixes: https://github.com/X11Libre/xserver/commit/d220a0a9f0473c15d5001f4730613b482eb0e39 Signed-off-by: stefan11111 <stefan11111@shitposting.expert>
This commit is contained in:
parent
04d4986004
commit
5b8ab55702
13
Xext/shm.c
13
Xext/shm.c
@ -197,20 +197,16 @@ CheckForShmSyscall(void)
|
||||
|
||||
#endif
|
||||
|
||||
static Bool shmPrivatesRegistered = FALSE;
|
||||
|
||||
/* Multiple calls to dixRegisterPrivateKey with the same arguments are allowed */
|
||||
static Bool
|
||||
ShmRegisterPrivates(void)
|
||||
{
|
||||
if (shmPrivatesRegistered)
|
||||
return TRUE;
|
||||
|
||||
if (!dixRegisterPrivateKey(&shmScrPrivateKeyRec, PRIVATE_SCREEN, sizeof(ShmScrPrivateRec)))
|
||||
return FALSE;
|
||||
if (!dixRegisterPrivateKey(&shmPixmapPrivateKeyRec, PRIVATE_PIXMAP, 0))
|
||||
return FALSE;
|
||||
|
||||
shmPrivatesRegistered = TRUE;
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
@ -1361,12 +1357,6 @@ static void ShmPixmapDestroy(CallbackListPtr *pcbl, ScreenPtr pScreen, PixmapPtr
|
||||
dixSetPrivate(&pPixmap->devPrivates, shmPixmapPrivateKey, NULL);
|
||||
}
|
||||
|
||||
static void ShmCloseScreen(CallbackListPtr *pcbl, ScreenPtr pScreen, void *unused)
|
||||
{
|
||||
shmPrivatesRegistered = FALSE;
|
||||
dixScreenUnhookClose(pScreen, ShmCloseScreen);
|
||||
}
|
||||
|
||||
void
|
||||
ShmExtensionInit(void)
|
||||
{
|
||||
@ -1391,7 +1381,6 @@ ShmExtensionInit(void)
|
||||
screen_priv->shmFuncs = &miFuncs;
|
||||
if (!screen_priv->shmFuncs->CreatePixmap)
|
||||
sharedPixmaps = xFalse;
|
||||
dixScreenHookClose(walkScreen, ShmCloseScreen);
|
||||
});
|
||||
if (sharedPixmaps)
|
||||
DIX_FOR_EACH_SCREEN({
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user