return VK_SUCCESS;
fail:
+ if (wsi_wl_surface->surface)
+ wl_proxy_wrapper_destroy(wsi_wl_surface->surface);
+
+ if (wsi_wl_surface->display)
+ wsi_wl_display_destroy(wsi_wl_surface->display);
return result;
}
result = wsi_swapchain_init(wsi_device, &chain->base, device,
pCreateInfo, image_params, pAllocator);
- if (result != VK_SUCCESS) {
- vk_free(pAllocator, chain);
- return result;
- }
+ if (result != VK_SUCCESS)
+ goto fail;
bool alpha = pCreateInfo->compositeAlpha ==
VK_COMPOSITE_ALPHA_PRE_MULTIPLIED_BIT_KHR;
fail_image_init:
wsi_wl_swapchain_images_free(chain);
-fail:
wsi_wl_swapchain_chain_free(chain, pAllocator);
+fail:
+ vk_free(pAllocator, chain);
+ wsi_wl_surface->chain = NULL;
return result;
}