dbe: 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:53:32 +02:00
parent eb5476381a
commit 668d9fc40e

View File

@ -162,7 +162,7 @@ miDbeAllocBackBufferName(WindowPtr pWin, XID bufId, int swapAction)
(*pScreen->CreatePixmap) (pScreen, pDbeWindowPriv->width,
pDbeWindowPriv->height,
pWin->drawable.depth, 0))) {
(*pScreen->DestroyPixmap) (pDbeWindowPriv->pFrontBuffer);
dixDestroyPixmap(pDbeWindowPriv->pFrontBuffer, 0);
return BadAlloc;
}
@ -426,14 +426,11 @@ miDbeWinPrivDelete(DbeWindowPrivPtr pDbeWindowPriv, XID bufId)
*/
/* Destroy the front and back pixmaps. */
if (pDbeWindowPriv->pFrontBuffer) {
(*pDbeWindowPriv->pWindow->drawable.pScreen->
DestroyPixmap) (pDbeWindowPriv->pFrontBuffer);
}
if (pDbeWindowPriv->pBackBuffer) {
(*pDbeWindowPriv->pWindow->drawable.pScreen->
DestroyPixmap) (pDbeWindowPriv->pBackBuffer);
}
if (pDbeWindowPriv->pFrontBuffer)
dixDestroyPixmap(pDbeWindowPriv->pFrontBuffer, 0);
if (pDbeWindowPriv->pBackBuffer)
dixDestroyPixmap(pDbeWindowPriv->pBackBuffer, 0);
} /* miDbeWinPrivDelete() */
/******************************************************************************
@ -585,13 +582,8 @@ miDbePositionWindow(WindowPtr pWin, int x, int y)
if (!pFrontBuffer || !pBackBuffer) {
/* We failed at creating 1 or 2 of the pixmaps. */
if (pFrontBuffer) {
(*pScreen->DestroyPixmap) (pFrontBuffer);
}
if (pBackBuffer) {
(*pScreen->DestroyPixmap) (pBackBuffer);
}
dixDestroyPixmap(pFrontBuffer, 0);
dixDestroyPixmap(pBackBuffer, 0);
/* Destroy all buffers for this window. */
while (pDbeWindowPriv) {
@ -642,8 +634,8 @@ miDbePositionWindow(WindowPtr pWin, int x, int y)
* pixmaps.
*/
(*pScreen->DestroyPixmap) (pDbeWindowPriv->pFrontBuffer);
(*pScreen->DestroyPixmap) (pDbeWindowPriv->pBackBuffer);
dixDestroyPixmap(pDbeWindowPriv->pFrontBuffer, 0);
dixDestroyPixmap(pDbeWindowPriv->pBackBuffer, 0);
pDbeWindowPriv->pFrontBuffer = pFrontBuffer;
pDbeWindowPriv->pBackBuffer = pBackBuffer;