From d77bb8e059ecfed9b714301fc31b093c6026c7bc Mon Sep 17 00:00:00 2001 From: Kristian Høgsberg Date: Fri, 23 Jul 2010 22:05:21 -0400 Subject: glx: Don't destroy context with XID 0 We use XID 0 to indicate the context has already been destroyed, but it's currently bound. --- src/glx/glxcmds.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'src/glx/glxcmds.c') diff --git a/src/glx/glxcmds.c b/src/glx/glxcmds.c index 1ded6247ef..b92638c9c2 100644 --- a/src/glx/glxcmds.c +++ b/src/glx/glxcmds.c @@ -584,7 +584,7 @@ glx_send_destroy_context(Display *dpy, XID xid) static void indirect_destroy_context(__GLXcontext *gc) { - if (!gc->imported) + if (!gc->imported && gc->xid) glx_send_destroy_context(gc->psc->dpy, gc->xid); __glXFreeVertexArrayState(gc); @@ -619,6 +619,8 @@ DestroyContext(Display * dpy, GLXContext gc) * Note that we set gc->xid = None above. In MakeContextCurrent() * we check for that and delete the context there. */ + if (!gc->imported) + glx_send_destroy_context(dpy, gc->xid); gc->xid = None; __glXUnlock(); return; -- cgit v1.2.3