wsi/wl: check wsi_wl_surface's validity before use

Fixes: 9a00a360ad ("wsi/wl: flush connection on swapchain failure")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27767>
This commit is contained in:
Pierre-Eric Pelloux-Prayer 2024-02-23 18:29:21 +01:00 committed by Marge Bot
parent 8ab337047c
commit a8a4bcec36

View file

@ -2226,7 +2226,8 @@ wsi_wl_swapchain_chain_free(struct wsi_wl_swapchain *chain,
* creation (see MAX_FDS_OUT) to avoid filling up VRAM with
* released buffers.
*/
wl_display_flush(chain->wsi_wl_surface->display->wl_display);
if (chain->wsi_wl_surface)
wl_display_flush(chain->wsi_wl_surface->display->wl_display);
if (chain->frame)
wl_callback_destroy(chain->frame);