aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJosé Fonseca <[email protected]>2009-04-09 15:15:12 +0100
committerJosé Fonseca <[email protected]>2009-04-09 15:22:15 +0100
commit564ba2538691bd15df21da9fc378f0070235e286 (patch)
tree60f1423a4bdf71533c7328a04a915277b92638cc
parent858d3da441d3548eae23c91b3bc888c3b0233797 (diff)
wgl: Catch the attempt of releasing a context which is not current.
-rw-r--r--src/gallium/state_trackers/wgl/shared/stw_context.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/src/gallium/state_trackers/wgl/shared/stw_context.c b/src/gallium/state_trackers/wgl/shared/stw_context.c
index 07d7452eb56..6eb1bd08d56 100644
--- a/src/gallium/state_trackers/wgl/shared/stw_context.c
+++ b/src/gallium/state_trackers/wgl/shared/stw_context.c
@@ -231,10 +231,17 @@ stw_release_context(
if (!ctx)
return FALSE;
- /* XXX: The expectation is that ctx is the same context which is
+ /* The expectation is that ctx is the same context which is
* current for this thread. We should check that and return False
* if not the case.
*/
+ {
+ GLcontext *glctx = ctx->st->ctx;
+ GET_CURRENT_CONTEXT( glcurctx );
+
+ if (glcurctx != glctx)
+ return FALSE;
+ }
if (stw_make_current( NULL, 0 ) == FALSE)
return FALSE;