winex11.drv: Check if the surface is in list in wine_vk_surface_release().

Fixes a regression introduced by
6dcaff421f.

Signed-off-by: Paul Gofman <pgofman@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Paul Gofman 2021-11-09 17:43:31 +03:00 committed by Alexandre Julliard
parent f183f8f946
commit 963589ee29
1 changed files with 6 additions and 3 deletions

View File

@ -211,9 +211,12 @@ static void wine_vk_surface_release(struct wine_vk_surface *surface)
if (InterlockedDecrement(&surface->ref))
return;
EnterCriticalSection(&context_section);
list_remove(&surface->entry);
LeaveCriticalSection(&context_section);
if (surface->entry.next)
{
EnterCriticalSection(&context_section);
list_remove(&surface->entry);
LeaveCriticalSection(&context_section);
}
if (surface->window)
XDestroyWindow(gdi_display, surface->window);