summaryrefslogtreecommitdiffstats
path: root/src/glx/dri_glx.c
diff options
context:
space:
mode:
authorKristian Høgsberg <[email protected]>2010-07-22 23:45:18 -0400
committerKristian Høgsberg <[email protected]>2010-07-23 22:05:52 -0400
commitc796bb0cc3fde409545bff320540ddf5c029e513 (patch)
treedded830c438042a6d7a97a260d33b27f49737271 /src/glx/dri_glx.c
parent80b331c7f6c3724f2044325e0d7d7c79ae5a4510 (diff)
glx: Move context destroy to context vtable
Diffstat (limited to 'src/glx/dri_glx.c')
-rw-r--r--src/glx/dri_glx.c27
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;