Browse Source

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.
tags/mesa-7.9-rc1
Kristian Høgsberg 15 years ago
parent
commit
d77bb8e059
4 changed files with 9 additions and 4 deletions
  1. 2
    1
      src/glx/dri2_glx.c
  2. 2
    1
      src/glx/dri_glx.c
  3. 2
    1
      src/glx/drisw_glx.c
  4. 3
    1
      src/glx/glxcmds.c

+ 2
- 1
src/glx/dri2_glx.c View File

@@ -119,7 +119,8 @@ dri2_destroy_context(__GLXcontext *context)
struct dri2_context *pcp = (struct dri2_context *) context;
struct dri2_screen *psc = (struct dri2_screen *) context->psc;

glx_send_destroy_context(psc->base.dpy, context->xid);
if (context->xid)
glx_send_destroy_context(psc->base.dpy, context->xid);

if (context->extensions)
XFree((char *) context->extensions);

+ 2
- 1
src/glx/dri_glx.c View File

@@ -505,7 +505,8 @@ dri_destroy_context(__GLXcontext * context)
struct dri_context *pcp = (struct dri_context *) context;
struct dri_screen *psc = (struct dri_screen *) context->psc;

glx_send_destroy_context(psc->base.dpy, context->xid);
if (context->xid)
glx_send_destroy_context(psc->base.dpy, context->xid);

if (context->extensions)
XFree((char *) context->extensions);

+ 2
- 1
src/glx/drisw_glx.c View File

@@ -245,7 +245,8 @@ drisw_destroy_context(__GLXcontext *context)
struct drisw_context *pcp = (struct drisw_context *) context;
struct drisw_screen *psc = (struct drisw_screen *) context->psc;

glx_send_destroy_context(psc->base.dpy, context->xid);
if (context->xid)
glx_send_destroy_context(psc->base.dpy, context->xid);

if (context->extensions)
XFree((char *) context->extensions);

+ 3
- 1
src/glx/glxcmds.c View File

@@ -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;

Loading…
Cancel
Save