wined3d: Free the swapchain context array in swapchain_destroy_contexts().

Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Henri Verbeet 2017-02-15 14:17:13 +01:00 committed by Alexandre Julliard
parent 908010d47b
commit 274b091c87
2 changed files with 4 additions and 5 deletions

View File

@ -4528,7 +4528,7 @@ void CDECL wined3d_device_evict_managed_resources(struct wined3d_device *device)
}
}
static void delete_opengl_contexts(struct wined3d_device *device, struct wined3d_swapchain *swapchain)
static void wined3d_device_delete_opengl_contexts(struct wined3d_device *device)
{
struct wined3d_resource *resource, *cursor;
struct wined3d_context *context;
@ -4561,9 +4561,6 @@ static void delete_opengl_contexts(struct wined3d_device *device, struct wined3d
else
context_destroy(device, device->contexts[0]);
}
HeapFree(GetProcessHeap(), 0, swapchain->context);
swapchain->context = NULL;
}
static HRESULT create_primary_opengl_context(struct wined3d_device *device, struct wined3d_swapchain *swapchain)
@ -4827,7 +4824,7 @@ HRESULT CDECL wined3d_device_reset(struct wined3d_device *device,
state_cleanup(&device->state);
if (device->d3d_initialized)
delete_opengl_contexts(device, swapchain);
wined3d_device_delete_opengl_contexts(device);
state_init(&device->state, &device->fb, &device->adapter->gl_info,
&device->adapter->d3d_info, WINED3D_STATE_INIT_DEFAULT);

View File

@ -1136,7 +1136,9 @@ void swapchain_destroy_contexts(struct wined3d_swapchain *swapchain)
{
context_destroy(swapchain->device, swapchain->context[i]);
}
HeapFree(GetProcessHeap(), 0, swapchain->context);
swapchain->num_contexts = 0;
swapchain->context = NULL;
}
struct wined3d_context *swapchain_get_context(struct wined3d_swapchain *swapchain)