summaryrefslogtreecommitdiff
path: root/src/glx/drisw_glx.c
diff options
context:
space:
mode:
authorKristian Høgsberg <krh@bitplanet.net>2010-07-22 23:45:18 -0400
committerKristian Høgsberg <krh@bitplanet.net>2010-07-23 22:05:52 -0400
commitc796bb0cc3fde409545bff320540ddf5c029e513 (patch)
treedded830c438042a6d7a97a260d33b27f49737271 /src/glx/drisw_glx.c
parent80b331c7f6c3724f2044325e0d7d7c79ae5a4510 (diff)
glx: Move context destroy to context vtable
Diffstat (limited to 'src/glx/drisw_glx.c')
-rw-r--r--src/glx/drisw_glx.c11
1 files changed, 9 insertions, 2 deletions
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;