summaryrefslogtreecommitdiff
path: root/glx/glxext.c
diff options
context:
space:
mode:
authorDave Airlie <airlied@redhat.com>2009-06-10 15:13:45 +1000
committerDave Airlie <airlied@redhat.com>2009-06-11 11:09:40 +1000
commit918923e285f4e269a257bb5be4d3c8a50174aad0 (patch)
treedbf82b34a0ee1f68869eb6ce65be8de2b718ebc8 /glx/glxext.c
parent3ea747c0dbbec0db6761d66d4f6c680d2e9ddeaf (diff)
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.
Diffstat (limited to 'glx/glxext.c')
-rw-r--r--glx/glxext.c16
1 files changed, 11 insertions, 5 deletions
diff --git a/glx/glxext.c b/glx/glxext.c
index bdacf8865..520eb2e3f 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;
+ }
+ }
}
/*