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);
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);
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);
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);
* 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;