(!1709) dix: make dixDestroyPixmap() NULL-proof

Make dixDestroyPixmap() check for NULL pointer, so callers don't need to
do it anymore. Returning TRUE on NULL pointer - but most callers won't
even look at the retval anyways.

Together with subsequent commits, which will make use of that function,
instead of calling raw ScreenRec->DestroyPixmap vectors, this gives us some
more freedom for architectural changes, eg. get rid of the extremely
complicated and fragile wrapping chains.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
This commit is contained in:
Enrico Weigelt, metux IT consult 2024-09-30 17:36:05 +02:00
parent e5d7ce8ea8
commit e271e6261d

View File

@ -1462,8 +1462,9 @@ int
dixDestroyPixmap(void *value, XID pid)
{
PixmapPtr pPixmap = (PixmapPtr) value;
return (*pPixmap->drawable.pScreen->DestroyPixmap) (pPixmap);
if (pPixmap && pPixmap->drawable.pScreen && pPixmap->drawable.pScreen->DestroyPixmap)
return pPixmap->drawable.pScreen->DestroyPixmap(pPixmap);
return TRUE;
}
int