xserver: Branch 'master'

Dave Airlie airlied at kemper.freedesktop.org
Wed Jun 10 18:13:35 PDT 2009


 glx/glxext.c |   16 +++++++++++-----
 1 file changed, 11 insertions(+), 5 deletions(-)

New commits:
commit 918923e285f4e269a257bb5be4d3c8a50174aad0
Author: Dave Airlie <airlied at redhat.com>
Date:   Wed Jun 10 15:13:45 2009 +1000

    glx: fix open-coded linked list removal function
    
    OMG stab stab stab, YALL.
    
    removal function was made of crack, actually truncated the list from
    the one after the find point.
    
    However fixing this makes glean makecurrent fail with a GLX error.

diff --git a/glx/glxext.c b/glx/glxext.c
index bdacf88..520eb2e 100644
--- a/glx/glxext.c
+++ b/glx/glxext.c
@@ -150,12 +150,18 @@ void __glXAddToContextList(__GLXcontext *cx)
 
 void __glXRemoveFromContextList(__GLXcontext *cx)
 {
-    __GLXcontext *c, **prev;
+    __GLXcontext *c, *prev;
 
-    prev = &glxAllContexts;
-    for (c = glxAllContexts; c; c = c->next)
-	if (c == cx)
-	    *prev = c->next;
+    if (cx == glxAllContexts)
+	glxAllContexts = cx->next;
+    else {
+	prev = glxAllContexts;
+	for (c = glxAllContexts; c; c = c->next) {
+	    if (c == cx)
+		prev->next = c->next;
+	    prev = c;
+	}
+    }
 }
 
 /*


More information about the xorg-commit mailing list