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/drisw_glx.c | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) (limited to 'src/glx/drisw_glx.c') diff --git a/src/glx/drisw_glx.c b/src/glx/drisw_glx.c index 0ad7391457..c971de2f76 100644 --- a/src/glx/drisw_glx.c +++ b/src/glx/drisw_glx.c @@ -240,11 +240,18 @@ static const __DRIextension *loader_extensions[] = { */ static void -driDestroyContext(__GLXcontext *context) +drisw_destroy_context(__GLXcontext *context) { 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->extensions) + XFree((char *) context->extensions); + + GarbageCollectDRIDrawables(context->psc); + (*psc->core->destroyContext) (pcp->driContext); Xfree(pcp); @@ -273,6 +280,7 @@ driUnbindContext(__GLXcontext * context) } static const struct glx_context_vtable drisw_context_vtable = { + drisw_destroy_context, NULL, NULL, DRI_glXUseXFont, @@ -318,7 +326,6 @@ driCreateContext(__GLXscreenConfigs *base, pcp->base.vtable = &drisw_context_vtable; pcp->base.driContext = &pcp->dri_vtable; - pcp->dri_vtable.destroyContext = driDestroyContext; pcp->dri_vtable.bindContext = driBindContext; pcp->dri_vtable.unbindContext = driUnbindContext; -- cgit v1.2.3