diff options
Diffstat (limited to 'src/glx/dri_glx.c')
-rw-r--r-- | src/glx/dri_glx.c | 27 |
1 files changed, 18 insertions, 9 deletions
diff --git a/src/glx/dri_glx.c b/src/glx/dri_glx.c index 352d833fd7d..ff7ca5ef7d6 100644 --- a/src/glx/dri_glx.c +++ b/src/glx/dri_glx.c @@ -92,13 +92,7 @@ struct dri_drawable __DRIdrawable *driDrawable; }; -static const struct glx_context_vtable dri_context_vtable = { - NULL, - NULL, - DRI_glXUseXFont, - NULL, - NULL, -}; +static const struct glx_context_vtable dri_context_vtable; /* * Given a display pointer and screen number, determine the name of @@ -506,11 +500,18 @@ CallCreateNewScreen(Display *dpy, int scrn, struct dri_screen *psc, } static void -driDestroyContext(__GLXcontext * context) +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->extensions) + XFree((char *) context->extensions); + + GarbageCollectDRIDrawables(context->psc); + (*psc->core->destroyContext) (pcp->driContext); XF86DRIDestroyContext(psc->base.dpy, psc->base.scr, pcp->hwContextID); @@ -539,6 +540,15 @@ driUnbindContext(__GLXcontext * context) (*psc->core->unbindContext) (pcp->driContext); } +static const struct glx_context_vtable dri_context_vtable = { + dri_destroy_context, + NULL, + NULL, + DRI_glXUseXFont, + NULL, + NULL, +}; + static __GLXcontext * driCreateContext(__GLXscreenConfigs *base, const __GLcontextModes * mode, @@ -587,7 +597,6 @@ driCreateContext(__GLXscreenConfigs *base, pcp->base.vtable = &dri_context_vtable; pcp->base.driContext = &pcp->dri_vtable; - pcp->dri_vtable.destroyContext = driDestroyContext; pcp->dri_vtable.bindContext = driBindContext; pcp->dri_vtable.unbindContext = driUnbindContext; |