summaryrefslogtreecommitdiffstats
path: root/src/glx/glxcmds.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/glx/glxcmds.c')
-rw-r--r--src/glx/glxcmds.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/glx/glxcmds.c b/src/glx/glxcmds.c
index 1ded6247ef3..b92638c9c22 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;