Hi,
alloc_shared_state() creates a hash table for ATI fragment shaders, but
free_shared_state() doesn't destroy it.
mesa-delete_atishaders.diff fixes this.

While looking at that code I also noticed that
ss->DefaultFragmentShader is destroyed by calling
_mesa_delete_ati_fragment_shader() in alloc_shared_state() (in the error
branch), but free_shared_state() just calls _mesa_free() on it.

mesa-delete_defaultatishader.diff makes free_shared_state() use
_mesa_delete_ati_fragment_shader(), too. It seems to be correct, but I
don't know for sure.
That second patch depends on the first.

Regards,
Tilman

-- 
GnuPG key available at
http://code-monkey.de/files/tsauerbeck-public-key.asc
Index: Mesa/src/mesa/main/context.c
===================================================================
--- Mesa.orig/src/mesa/main/context.c
+++ Mesa/src/mesa/main/context.c
@@ -869,6 +869,7 @@ free_shared_state( GLcontext *ctx, struc
    _mesa_delete_program(ctx, ss->DefaultFragmentProgram);
 #endif
 #if FEATURE_ATI_fragment_shader
+   _mesa_DeleteHashTable(ss->ATIShaders);
    _mesa_free(ss->DefaultFragmentShader);
 #endif
 
Index: Mesa/src/mesa/main/context.c
===================================================================
--- Mesa.orig/src/mesa/main/context.c
+++ Mesa/src/mesa/main/context.c
@@ -870,7 +870,7 @@ free_shared_state( GLcontext *ctx, struc
 #endif
 #if FEATURE_ATI_fragment_shader
    _mesa_DeleteHashTable(ss->ATIShaders);
-   _mesa_free(ss->DefaultFragmentShader);
+   _mesa_delete_ati_fragment_shader(ctx, ss->DefaultFragmentShader);
 #endif
 
 #if FEATURE_ARB_vertex_buffer_object

Attachment: pgpSKukNJEPnO.pgp
Description: PGP signature

Reply via email to