delete shader objects when destroying shared context state
diff --git a/src/mesa/main/context.c b/src/mesa/main/context.c
index c8acc6b..44ee046 100644
--- a/src/mesa/main/context.c
+++ b/src/mesa/main/context.c
@@ -876,6 +876,16 @@
_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 @@
_mesa_DeleteHashTable(ss->ArrayObjects);
#if FEATURE_ARB_shader_objects
+ _mesa_HashDeleteAll(ss->GL2Objects, delete_shaderobj_cb, ctx);
_mesa_DeleteHashTable(ss->GL2Objects);
#endif