From 4d4373bb0fa06093d82796950ede5a26fbfdd1d4 Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Sat, 18 Nov 2006 17:44:28 +0000 Subject: delete shader objects when destroying shared context state --- src/mesa/main/context.c | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'src/mesa/main/context.c') diff --git a/src/mesa/main/context.c b/src/mesa/main/context.c index c8acc6b55ca..44ee0465690 100644 --- a/src/mesa/main/context.c +++ b/src/mesa/main/context.c @@ -876,6 +876,16 @@ delete_arrayobj_cb(GLuint id, void *data, void *userData) _mesa_delete_array_object(ctx, arrayObj); } +/** + * Callback for deleting an shader object. Called by _mesa_HashDeleteAll(). + */ +static void +delete_shaderobj_cb(GLuint id, void *data, void *userData) +{ + /* XXX probably need to fix this */ + _mesa_free(data); +} + /** * Deallocate a shared state object and all children structures. @@ -938,6 +948,7 @@ free_shared_state( GLcontext *ctx, struct gl_shared_state *ss ) _mesa_DeleteHashTable(ss->ArrayObjects); #if FEATURE_ARB_shader_objects + _mesa_HashDeleteAll(ss->GL2Objects, delete_shaderobj_cb, ctx); _mesa_DeleteHashTable(ss->GL2Objects); #endif -- cgit v1.2.3