Xext: shm: use dixDestroyPixmap() instead of direct driver call

Direct calls to ScreenRec->DestroyPixmap() blocks cleaning up the wrapping
jungle, so use the proper dix function instead.

See: https://gitlab.freedesktop.org/xorg/xserver/-/issues/1754

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1711>
This commit is contained in:
Enrico Weigelt, metux IT consult 2024-09-30 17:49:06 +02:00
parent 7ce19233bc
commit c0f3b5bcef

View File

@ -511,7 +511,7 @@ doShmPutImage(DrawablePtr dst, GCPtr pGC,
else else
(void) (*pGC->ops->CopyArea) (&pPixmap->drawable, dst, pGC, 0, 0, (void) (*pGC->ops->CopyArea) (&pPixmap->drawable, dst, pGC, 0, 0,
sw, sh, dx, dy); sw, sh, dx, dy);
(*pPixmap->drawable.pScreen->DestroyPixmap) (pPixmap); dixDestroyPixmap(pPixmap, 0);
} }
} }
@ -1001,7 +1001,7 @@ ProcPanoramiXShmCreatePixmap(ClientPtr client)
result = XaceHookResourceAccess(client, stuff->pid, result = XaceHookResourceAccess(client, stuff->pid,
X11_RESTYPE_PIXMAP, pMap, X11_RESTYPE_NONE, NULL, DixCreateAccess); X11_RESTYPE_PIXMAP, pMap, X11_RESTYPE_NONE, NULL, DixCreateAccess);
if (result != Success) { if (result != Success) {
pDraw->pScreen->DestroyPixmap(pMap); dixDestroyPixmap(pMap, 0);
break; break;
} }
dixSetPrivate(&pMap->devPrivates, shmPixmapPrivateKey, shmdesc); dixSetPrivate(&pMap->devPrivates, shmPixmapPrivateKey, shmdesc);
@ -1045,7 +1045,7 @@ fbShmCreatePixmap(ScreenPtr pScreen,
BitsPerPixel(depth), BitsPerPixel(depth),
PixmapBytePad(width, depth), PixmapBytePad(width, depth),
(void *) addr)) { (void *) addr)) {
(*pScreen->DestroyPixmap) (pPixmap); dixDestroyPixmap(pPixmap, 0);
return NullPixmap; return NullPixmap;
} }
return pPixmap; return pPixmap;
@ -1116,7 +1116,7 @@ ProcShmCreatePixmap(ClientPtr client)
rc = XaceHookResourceAccess(client, stuff->pid, X11_RESTYPE_PIXMAP, rc = XaceHookResourceAccess(client, stuff->pid, X11_RESTYPE_PIXMAP,
pMap, X11_RESTYPE_NONE, NULL, DixCreateAccess); pMap, X11_RESTYPE_NONE, NULL, DixCreateAccess);
if (rc != Success) { if (rc != Success) {
pDraw->pScreen->DestroyPixmap(pMap); dixDestroyPixmap(pMap, 0);
return rc; return rc;
} }
dixSetPrivate(&pMap->devPrivates, shmPixmapPrivateKey, shmdesc); dixSetPrivate(&pMap->devPrivates, shmPixmapPrivateKey, shmdesc);