Revision
168
Author
gstaplin@apple.com
Date
2009-02-18 03:28:00 -0800 (Wed, 18 Feb 2009)

Log Message

If the current CGL context is from a GLXPixmap then set the
CGL context to NULL when destroying the GLXPimap.

Note: the previous commit also fixed a bug in free() ordering.

Modified Paths

Diff

Modified: AppleSGLX/trunk/apple_glx_pixmap.c (167 => 168)


--- AppleSGLX/trunk/apple_glx_pixmap.c	2009-02-18 11:23:56 UTC (rev 167)
+++ AppleSGLX/trunk/apple_glx_pixmap.c	2009-02-18 11:28:00 UTC (rev 168)
@@ -174,6 +174,10 @@
     lock_pixmap_list();
 
     if(find_pixmap(pixmap, &p)) {
+	if(p->context_obj == apple_cgl.get_current_context()) {
+	    apple_cgl.set_current_context(NULL);
+	}
+
 	(void)apple_cgl.destroy_pixel_format(p->pixel_format_obj);
 	(void)apple_cgl.destroy_context(p->context_obj);
 	XAppleDRIDestroyPixmap(dpy, pixmap);