On error during wsi_wl_surface_create_swapchain(),
wsi_wl_swapchain_chain_free() is called, followed by vk_free() of the
recently freed chain.
Move the vk_free() to wsi_wl_swapchain_destroy() to avoid the double
free.
Fixes dEQP-VK.wsi.wayland.swapchain.simulate_oom.*
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23383>
}
wsi_swapchain_finish(&chain->base);
-
- vk_free(pAllocator, chain);
}
static VkResult
wsi_wl_swapchain_images_free(chain);
wsi_wl_swapchain_chain_free(chain, pAllocator);
+ vk_free(pAllocator, chain);
+
return VK_SUCCESS;
}