Paul Gofman (@gofman) commented about dlls/winex11.drv/vulkan.c:
-void wine_vk_surface_destroy(HWND hwnd) +static void wine_vk_surface_detach( struct wine_vk_surface *surface ) {
- struct wine_vk_surface *surface;
- pthread_mutex_lock(&vulkan_mutex);
- if (!XFindContext(gdi_display, (XID)hwnd, vulkan_hwnd_context, (char **)&surface))
- struct x11drv_win_data *data;
- TRACE( "Detaching surface %p, hwnd %p.\n", surface, surface->hwnd );
- if (surface->window && (data = get_win_data( surface->hwnd ))) {
surface->hwnd_thread_id = 0;
surface->hwnd = NULL;
wine_vk_surface_release(surface);
I think this is important refcounting change but a bit separate from what the rest of the patch is doing. Before the patchset the code assumes that window holds the reference to the surface (while tracking the release is a bit convoluted). The idea of the change (which I believe is correct) is to get rid of this reference and make only app creating surface (and swapchain later in this patchset) hold the reference. Surface may be deleted without deleting window (currently doing so will effectively leak surfaces if the app creates and destroy surfaces). Do you think it maybe worth splitting the refcounting change from this patch to a separate one?