Module: wine
Branch: master
Commit: 59226e36b79b60a26345481022109ccce9341cb4
URL: http://source.winehq.org/git/wine.git/?a=commit;h=59226e36b79b60a2634548102…
Author: Ken Thomases <ken(a)codeweavers.com>
Date: Wed Feb 5 15:24:19 2014 -0600
wined3d: Don't clear the GL context if it's not the one being destroyed by context_destroy_gl_resources().
The previous code clears the GL context if the context being destroyed is
not valid, even though the current one is some arbitrary, unrelated context.
---
dlls/wined3d/context.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/dlls/wined3d/context.c b/dlls/wined3d/context.c
index 587613c..c835414 100644
--- a/dlls/wined3d/context.c
+++ b/dlls/wined3d/context.c
@@ -888,10 +888,10 @@ static void context_destroy_gl_resources(struct wined3d_context *context)
restore_dc = wglGetCurrentDC();
restore_pf = GetPixelFormat(restore_dc);
- if (context->valid && restore_ctx != context->glCtx)
- context_set_gl_context(context);
- else
+ if (restore_ctx == context->glCtx)
restore_ctx = NULL;
+ else if (context->valid)
+ context_set_gl_context(context);
LIST_FOR_EACH_ENTRY(occlusion_query, &context->occlusion_queries, struct wined3d_occlusion_query, entry)
{
Module: wine
Branch: master
Commit: 75d53c9aed0b93b5a3607d2949d04d0570e781b1
URL: http://source.winehq.org/git/wine.git/?a=commit;h=75d53c9aed0b93b5a3607d294…
Author: Ken Thomases <ken(a)codeweavers.com>
Date: Wed Feb 5 14:01:15 2014 -0600
wined3d: Don't clear the GL context such that it can't be restored.
---
dlls/wined3d/device.c | 3 ---
1 file changed, 3 deletions(-)
diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c
index 256052f..4cd6342 100644
--- a/dlls/wined3d/device.c
+++ b/dlls/wined3d/device.c
@@ -1016,9 +1016,6 @@ HRESULT CDECL wined3d_device_uninit_3d(struct wined3d_device *device)
if (!device->d3d_initialized)
return WINED3DERR_INVALIDCALL;
- /* Force making the context current again, to verify it is still valid
- * (workaround for broken drivers) */
- context_set_current(NULL);
/* I don't think that the interface guarantees that the device is destroyed from the same thread
* it was created. Thus make sure a context is active for the glDelete* calls
*/