gdkvulkancontext: remove incorrect vkDestroySwapchainKHR

Confusingly, the function that creates the next swapchain also "retires"
the current one. Trying to destroy it again results in closing an fd we
no longer own.

Fixes #6969
This commit is contained in:
Michael Catanzaro 2024-08-30 14:21:42 -05:00
parent 63b68d2f5e
commit 804acfdc2a

View File

@ -484,9 +484,8 @@ gdk_vulkan_context_check_swapchain (GdkVulkanContext *context,
if (priv->swapchain != VK_NULL_HANDLE)
{
vkDestroySwapchainKHR (device,
priv->swapchain,
NULL);
/* priv->swapchain was just retired by vkCreateSwapchainKHR */
priv->swapchain = VK_NULL_HANDLE;
for (i = 0; i < priv->n_images; i++)
{
cairo_region_destroy (priv->regions[i]);
@ -523,7 +522,6 @@ gdk_vulkan_context_check_swapchain (GdkVulkanContext *context,
{
g_set_error (error, GDK_VULKAN_ERROR, GDK_VULKAN_ERROR_NOT_AVAILABLE,
"Could not create swapchain for this surface: %s", gdk_vulkan_strerror (res));
priv->swapchain = VK_NULL_HANDLE;
return FALSE;
}