Revision: 371 http://trac.macosforge.org/projects/xquartz/changeset/371 Author: jeremyhu@freedesktop.org Date: 2009-09-30 12:11:00 -0700 (Wed, 30 Sep 2009) Log Message: ----------- Don't crash when trying to initialize GLX when run as a remote client. This should fix the crash mentioned in ticket #317 Modified Paths: -------------- AppleSGLX/trunk/glxcmds.c AppleSGLX/trunk/glxext.c Modified: AppleSGLX/trunk/glxcmds.c =================================================================== --- AppleSGLX/trunk/glxcmds.c 2009-09-17 01:21:29 UTC (rev 370) +++ AppleSGLX/trunk/glxcmds.c 2009-09-30 19:11:00 UTC (rev 371) @@ -1401,6 +1401,10 @@ int i; *nelements = 0; + + if(!priv) + return NULL; + if ( (priv->screenConfigs != NULL) && (screen >= 0) && (screen <= ScreenCount(dpy)) && (priv->screenConfigs[screen].configs != NULL) Modified: AppleSGLX/trunk/glxext.c =================================================================== --- AppleSGLX/trunk/glxext.c 2009-09-17 01:21:29 UTC (rev 370) +++ AppleSGLX/trunk/glxext.c 2009-09-30 19:11:00 UTC (rev 371) @@ -758,9 +758,8 @@ if (glx_direct) dpyPriv->driswDisplay = driswCreateDisplay(dpy); #endif - apple_init_glx(dpy); - if (!AllocAndFetchScreenConfigs(dpy, dpyPriv)) { + if (apple_init_glx(dpy) || !AllocAndFetchScreenConfigs(dpy, dpyPriv)) { __glXUnlock(); Xfree((char*) dpyPriv); Xfree((char*) private);