summaryrefslogtreecommitdiff
path: root/src/glx/dri2_glx.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/glx/dri2_glx.c')
-rw-r--r--src/glx/dri2_glx.c11
1 files changed, 9 insertions, 2 deletions
diff --git a/src/glx/dri2_glx.c b/src/glx/dri2_glx.c
index ae5bf535af..02c0f9f24e 100644
--- a/src/glx/dri2_glx.c
+++ b/src/glx/dri2_glx.c
@@ -114,11 +114,18 @@ struct dri2_drawable
static const struct glx_context_vtable dri2_context_vtable;
static void
-dri2DestroyContext(__GLXcontext *context)
+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->extensions)
+ XFree((char *) context->extensions);
+
+ GarbageCollectDRIDrawables(context->psc);
+
(*psc->core->destroyContext) (pcp->driContext);
Xfree(pcp);
@@ -182,7 +189,6 @@ dri2CreateContext(__GLXscreenConfigs *base,
pcp->base.vtable = &dri2_context_vtable;
pcp->base.driContext = &pcp->dri_vtable;
- pcp->dri_vtable.destroyContext = dri2DestroyContext;
pcp->dri_vtable.bindContext = dri2BindContext;
pcp->dri_vtable.unbindContext = dri2UnbindContext;
@@ -675,6 +681,7 @@ dri2_release_tex_image(Display * dpy, GLXDrawable drawable, int buffer)
}
static const struct glx_context_vtable dri2_context_vtable = {
+ dri2_destroy_context,
dri2_wait_gl,
dri2_wait_x,
DRI_glXUseXFont,