Rémi Bernon (@rbernon) commented about dlls/winewayland.drv/wayland_surface.c:
+ + free(client); + + return TRUE; +} + +/********************************************************************** + * wayland_surface_get_client + */ +struct wayland_client_surface *wayland_surface_get_client(struct wayland_surface *surface) +{ + if (surface->client) + { + InterlockedIncrement(&surface->client->ref); + return surface->client; + } Fwiw, something to keep in mind, if not necessarily something to take into account now, as winex11 has the same issue: Proton work showed us that multiple vulkan surfaces may be created for the same window, possibly outliving it.
Only one is active at a time, but we had to decouple the windowing data from the vulkan client surfaces. Instead we keep the vulkan surfaces and their X11 window live in a vulkan-specific list, reparenting them with their windows as they become active or inactive. At the very least, I don't think we should return the client surface twice, when creating different win32 surfaces. -- https://gitlab.winehq.org/wine/wine/-/merge_requests/4340#note_51619