From b4742253862c82affe5a1bbcb2f21eb955abaf6a Mon Sep 17 00:00:00 2001 From: Henri Verbeet Date: Mon, 22 Aug 2011 21:02:45 +0200 Subject: [PATCH] wined3d: Only delete the GL contexts after unloading resources in wined3d_device_reset(). The updateSurfaceDesc() calls potentially make GL calls. --- dlls/wined3d/device.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c index 819e4814cb2..0fa385c0e16 100644 --- a/dlls/wined3d/device.c +++ b/dlls/wined3d/device.c @@ -5762,8 +5762,6 @@ HRESULT CDECL wined3d_device_reset(struct wined3d_device *device, wined3d_stateblock_decref(device->updateStateBlock); wined3d_stateblock_decref(device->stateBlock); - delete_opengl_contexts(device, swapchain); - if (present_parameters->Windowed) { mode.Width = swapchain->orig_width; @@ -5819,6 +5817,8 @@ HRESULT CDECL wined3d_device_reset(struct wined3d_device *device, } } + delete_opengl_contexts(device, swapchain); + if (!present_parameters->Windowed != !swapchain->presentParms.Windowed || DisplayModeChanged) {