summaryrefslogtreecommitdiffstats
path: root/src/glx/dri_glx.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/glx/dri_glx.c')
-rw-r--r--src/glx/dri_glx.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/glx/dri_glx.c b/src/glx/dri_glx.c
index d0f680de636..eaf8e3b7f25 100644
--- a/src/glx/dri_glx.c
+++ b/src/glx/dri_glx.c
@@ -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);