From c796bb0cc3fde409545bff320540ddf5c029e513 Mon Sep 17 00:00:00 2001 From: Kristian Høgsberg Date: Thu, 22 Jul 2010 23:45:18 -0400 Subject: glx: Move context destroy to context vtable --- src/glx/dri2_glx.c | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) (limited to 'src/glx/dri2_glx.c') 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, -- cgit v1.2.3