summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBrian Paul <[email protected]>2006-11-18 17:44:28 +0000
committerBrian Paul <[email protected]>2006-11-18 17:44:28 +0000
commit4d4373bb0fa06093d82796950ede5a26fbfdd1d4 (patch)
tree9b0408ee37aa592cdc2f68deb409dfa64f2f5e68
parenta89e063149e183760e8dc2783922cbd389fc106e (diff)
delete shader objects when destroying shared context state
-rw-r--r--src/mesa/main/context.c11
1 files changed, 11 insertions, 0 deletions
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