Commit 79f4ca9e authored by Henri Verbeet's avatar Henri Verbeet Committed by Alexandre Julliard

wined3d: Release the context before potentially destroying the swapchain in…

wined3d: Release the context before potentially destroying the swapchain in wined3d_device_uninit_3d() (Valgrind).
parent 61a40b0d
......@@ -1086,6 +1086,12 @@ HRESULT CDECL wined3d_device_uninit_3d(struct wined3d_device *device)
device->shader_backend->shader_free_private(device);
destroy_dummy_textures(device, gl_info);
/* Release the context again as soon as possible. In particular,
* releasing the render target views below may release the last reference
* to the swapchain associated with this context, which in turn will
* destroy the context. */
context_release(context);
/* Release the buffers (with sanity checks)*/
if (device->onscreen_depth_stencil)
{
......@@ -1123,8 +1129,6 @@ HRESULT CDECL wined3d_device_uninit_3d(struct wined3d_device *device)
device->back_buffer_view = NULL;
}
context_release(context);
for (i = 0; i < device->swapchain_count; ++i)
{
TRACE("Releasing the implicit swapchain %u.\n", i);
......
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