This fixes a regression introduced by 49d7e48b33264d94e30af6129c281b6acafa9427

Signed-off-by: Jeremy Huddleston <jerem...@apple.com>
---
 src/glx/glxcurrent.c |   14 +++++++-------
 1 files changed, 7 insertions(+), 7 deletions(-)

diff --git origin/master/src/glx/glxcurrent.c origin/master/src/glx/glxcurrent.c
index 9eb7d5a..0f39ee5 100644
--- origin/master/src/glx/glxcurrent.c
+++ origin/master/src/glx/glxcurrent.c
@@ -255,13 +255,6 @@ MakeContextCurrent(Display * dpy, GLXDrawable draw,
       if (--oldGC->thread_refcount == 0) {
         oldGC->vtable->unbind(oldGC, gc);
         oldGC->currentDpy = 0;
-
-        if (oldGC->xid == None && oldGC != gc) {
-           /* We are switching away from a context that was
-            * previously destroyed, so we need to free the memory
-            * for the old handle. */
-           oldGC->vtable->destroy(oldGC);
-        }
       }
    }
 
@@ -279,6 +272,13 @@ MakeContextCurrent(Display * dpy, GLXDrawable draw,
       __glXSetCurrentContextNull();
    }
 
+   if (oldGC->thread_refcount == 0 && oldGC != &dummyContext && oldGC->xid == 
None) {
+      /* We are switching away from a context that was
+       * previously destroyed, so we need to free the memory
+       * for the old handle. */
+      oldGC->vtable->destroy(oldGC);
+   }
+
    __glXUnlock();
 
    if (ret) {
-- 
1.7.5.4


_______________________________________________
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/mesa-dev

Reply via email to