Mesa (master): wgl: Catch the attempt of releasing a context which is not current.

Jose Fonseca jrfonseca at kemper.freedesktop.org
Thu Apr 9 14:22:19 UTC 2009


Module: Mesa
Branch: master
Commit: 564ba2538691bd15df21da9fc378f0070235e286
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=564ba2538691bd15df21da9fc378f0070235e286

Author: José Fonseca <jfonseca at vmware.com>
Date:   Thu Apr  9 15:15:12 2009 +0100

wgl: Catch the attempt of releasing a context which is not current.

---

 .../state_trackers/wgl/shared/stw_context.c        |    9 ++++++++-
 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 07d7452..6eb1bd0 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;




More information about the mesa-commit mailing list