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> Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1709>
This commit is contained in:
parent
ef62929f58
commit
24d693c5ae
|
@ -1462,8 +1462,9 @@ int
|
||||||
dixDestroyPixmap(void *value, XID pid)
|
dixDestroyPixmap(void *value, XID pid)
|
||||||
{
|
{
|
||||||
PixmapPtr pPixmap = (PixmapPtr) value;
|
PixmapPtr pPixmap = (PixmapPtr) value;
|
||||||
|
if (pPixmap && pPixmap->drawable.pScreen && pPixmap->drawable.pScreen->DestroyPixmap)
|
||||||
return (*pPixmap->drawable.pScreen->DestroyPixmap) (pPixmap);
|
return pPixmap->drawable.pScreen->DestroyPixmap(pPixmap);
|
||||||
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
int
|
int
|
||||||
|
|
Loading…
Reference in New Issue