Follow suggestion by Aapo Tahkola to fix giant memory leak from forgetting to free the key when entry was already found (presumably a common case).
This commit is contained in:
@@ -1145,6 +1145,7 @@ void _mesa_UpdateTexEnvProgram( GLcontext *ctx )
|
||||
|
||||
cache_item(&ctx->Texture.env_fp_cache, hash, key, ctx->_TexEnvProgram);
|
||||
} else {
|
||||
FREE(key);
|
||||
if (0) _mesa_printf("Found existing texenv program for key %x\n", hash);
|
||||
}
|
||||
|
||||
|
@@ -1473,6 +1473,7 @@ void _tnl_UpdateFixedFunctionProgram( GLcontext *ctx )
|
||||
cache_item(&tnl->vp_cache, hash, key, ctx->_TnlProgram );
|
||||
}
|
||||
else {
|
||||
FREE(key);
|
||||
if (0)
|
||||
_mesa_printf("Found existing TNL program for key %x\n", hash);
|
||||
}
|
||||
|
Reference in New Issue
Block a user