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.
--- 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;