summaryrefslogtreecommitdiffstats
path: root/src/mesa/main
diff options
context:
space:
mode:
authorBrian Paul <[email protected]>2006-01-16 16:35:13 +0000
committerBrian Paul <[email protected]>2006-01-16 16:35:13 +0000
commit1096eae18d1c871f33f46d0d34e5a894354c3c44 (patch)
tree8896334e7935279ef162776480334f03a21a32b3 /src/mesa/main
parent361bccb4ecf90b56da1355e077a5da477aa2f520 (diff)
properly free ATI fragment shaders (Tilman Sauerbeck)
Diffstat (limited to 'src/mesa/main')
-rw-r--r--src/mesa/main/context.c24
1 files changed, 21 insertions, 3 deletions
diff --git a/src/mesa/main/context.c b/src/mesa/main/context.c
index 4101c9f1ed2..8d42c2168e1 100644
--- a/src/mesa/main/context.c
+++ b/src/mesa/main/context.c
@@ -845,8 +845,8 @@ free_shared_state( GLcontext *ctx, struct gl_shared_state *ss )
}
_mesa_DeleteHashTable(ss->TexObjects);
-#if FEATURE_NV_vertex_program
- /* Free vertex programs */
+#if defined(FEATURE_NV_vertex_program) || defined(FEATURE_NV_fragment_program)
+ /* Free vertex/fragment programs */
while (1) {
GLuint prog = _mesa_HashFirstEntry(ss->Programs);
if (prog) {
@@ -868,15 +868,33 @@ free_shared_state( GLcontext *ctx, struct gl_shared_state *ss )
#if FEATURE_ARB_fragment_program
_mesa_delete_program(ctx, ss->DefaultFragmentProgram);
#endif
+
#if FEATURE_ATI_fragment_shader
- _mesa_free(ss->DefaultFragmentShader);
+ /* Free ATI fragment shaders */
+ while (1) {
+ GLuint prog = _mesa_HashFirstEntry(ss->ATIShaders);
+ if (prog) {
+ struct ati_fragment_shader *s = (struct ati_fragment_shader *)
+ _mesa_HashLookup(ss->ATIShaders, prog);
+ ASSERT(s);
+ _mesa_delete_ati_fragment_shader(ctx, s);
+ _mesa_HashRemove(ss->ATIShaders, prog);
+ }
+ else {
+ break;
+ }
+ }
+ _mesa_DeleteHashTable(ss->ATIShaders);
+ _mesa_delete_ati_fragment_shader(ctx, ss->DefaultFragmentShader);
#endif
#if FEATURE_ARB_vertex_buffer_object
_mesa_DeleteHashTable(ss->BufferObjects);
#endif
+#if FEATURE_ARB_shader_objects
_mesa_DeleteHashTable (ss->GL2Objects);
+#endif
#if FEATURE_EXT_framebuffer_object
_mesa_DeleteHashTable(ss->FrameBuffers);