Test if the drawable is the current drawable in a safer way. Before if the context was new and glXSwapBuffers was called without a drawable made current, it would likely crash while dereferencing NULL. We want it to generate a nice XError instead.
--- AppleSGLX/trunk/apple_glx_context.c 2009-02-26 07:12:59 UTC (rev 261)
+++ AppleSGLX/trunk/apple_glx_context.c 2009-02-26 07:49:45 UTC (rev 262)
@@ -489,7 +489,7 @@
assert(NULL != ac);
- return (ac->drawable->drawable == drawable);
+ return (ac->drawable && ac->drawable->drawable == drawable);
}
/* Return true if an error occurred. */