Revision
193
Author
gstaplin@apple.com
Date
2009-02-19 20:01:49 -0800 (Thu, 19 Feb 2009)

Log Message

Handle the old context differently in the case of MakeContextCurrent.

I forgot that the code returns &dummyContext if the pthread_get_specific
is NULL.  So the test was invalid.

We need a shared context test added to the test suite.

Modified Paths

Diff

Modified: AppleSGLX/trunk/glxcurrent.c (192 => 193)


--- AppleSGLX/trunk/glxcurrent.c	2009-02-20 03:56:39 UTC (rev 192)
+++ AppleSGLX/trunk/glxcurrent.c	2009-02-20 04:01:49 UTC (rev 193)
@@ -137,7 +137,9 @@
 {
     const GLXContext oldGC = __glXGetCurrentContext();
      
-    if(apple_glx_make_current_context(dpy, oldGC ? oldGC->apple : NULL, 
+    if(apple_glx_make_current_context(dpy, 
+				      (oldGC && oldGC != &dummyContext) ?
+				      oldGC->apple : NULL, 
 				      gc ? gc->apple : NULL,
 				      draw))
 	return GL_FALSE;