vulkan/wsi: Close file descriptors in wsi_destroy_image
authorJason Ekstrand <jason@jlekstrand.net>
Mon, 2 Mar 2020 23:16:33 +0000 (17:16 -0600)
committerMarge Bot <emma+marge@anholt.net>
Wed, 4 May 2022 22:09:01 +0000 (22:09 +0000)
commitc72ff19a9ef7ef0fbb5b9b7ae8c7224523297a62
treec431575be4def8e2f07e0054b1a54586c61d94bb
parentae6d32c938fc79ff5019806a2592097ca97bd945
vulkan/wsi: Close file descriptors in wsi_destroy_image

Most of the time, this is a non-issue because the WSI back-end closes
them as part of handing them to the window-system and sets fds[*] to -1.
The one exception here was Wayland which was closing them but leaving
fds[*] pointing to bogus file descriptors.  Having wsi_destroy_image
close them makes clean-up easier and more reliable.

Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Simon Ser <contact@emersion.fr>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16333>
src/vulkan/wsi/wsi_common.c
src/vulkan/wsi/wsi_common_display.c
src/vulkan/wsi/wsi_common_drm.c
src/vulkan/wsi/wsi_common_private.h
src/vulkan/wsi/wsi_common_wayland.c