Commit 1ba7247a authored by Henri Verbeet's avatar Henri Verbeet Committed by Alexandre Julliard

wined3d: Unhook swapchains in swapchain_cleanup().

So that the hook is properly removed on failure in wined3d_swapchain_create(). This is a somewhat theoretical though, since in practice WINED3D_SWAPCHAIN_HOOK and WINED3D_SWAPCHAIN_IMPLICIT are never used together. Signed-off-by: 's avatarHenri Verbeet <hverbeet@codeweavers.com> Signed-off-by: 's avatarAlexandre Julliard <julliard@winehq.org>
parent 3a2a176a
...@@ -39,6 +39,7 @@ static void swapchain_cleanup(struct wined3d_swapchain *swapchain) ...@@ -39,6 +39,7 @@ static void swapchain_cleanup(struct wined3d_swapchain *swapchain)
TRACE("Destroying swapchain %p.\n", swapchain); TRACE("Destroying swapchain %p.\n", swapchain);
wined3d_unhook_swapchain(swapchain);
wined3d_swapchain_set_gamma_ramp(swapchain, 0, &swapchain->orig_gamma); wined3d_swapchain_set_gamma_ramp(swapchain, 0, &swapchain->orig_gamma);
/* Release the swapchain's draw buffers. Make sure swapchain->back_buffers[0] /* Release the swapchain's draw buffers. Make sure swapchain->back_buffers[0]
...@@ -121,7 +122,6 @@ ULONG CDECL wined3d_swapchain_decref(struct wined3d_swapchain *swapchain) ...@@ -121,7 +122,6 @@ ULONG CDECL wined3d_swapchain_decref(struct wined3d_swapchain *swapchain)
device = swapchain->device; device = swapchain->device;
if (device->swapchain_count && device->swapchains[0] == swapchain) if (device->swapchain_count && device->swapchains[0] == swapchain)
wined3d_device_uninit_3d(device); wined3d_device_uninit_3d(device);
wined3d_unhook_swapchain(swapchain);
wined3d_cs_finish(device->cs, WINED3D_CS_QUEUE_DEFAULT); wined3d_cs_finish(device->cs, WINED3D_CS_QUEUE_DEFAULT);
swapchain_cleanup(swapchain); swapchain_cleanup(swapchain);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment