Avoid a crash if the previous current context was NULL, and the new current context is NULL, by avoiding the dereference of a NULL pointer.
--- AppleSGLX/trunk/glxcurrent.c 2009-02-20 03:41:00 UTC (rev 190)
+++ AppleSGLX/trunk/glxcurrent.c 2009-02-20 03:51:10 UTC (rev 191)
@@ -152,8 +152,10 @@
* cannot be NULL, therefore if they are the same, gc is not
* NULL and not the dummy.
*/
- gc->currentDrawable = draw;
- gc->currentReadable = read;
+ if(gc) {
+ gc->currentDrawable = draw;
+ gc->currentReadable = read;
+ }
} else {
if (oldGC != &dummyContext) {