[Mesa-dev] [PATCH] st/mesa: don't leak glsl_to_tgsi object on link failure

Kenneth Graunke kenneth at whitecape.org
Sun May 17 14:37:19 PDT 2015


On Sunday, May 17, 2015 05:32:24 PM Ilia Mirkin wrote:
> Signed-off-by: Ilia Mirkin <imirkin at alum.mit.edu>
> ---
>  src/mesa/state_tracker/st_glsl_to_tgsi.cpp | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/src/mesa/state_tracker/st_glsl_to_tgsi.cpp b/src/mesa/state_tracker/st_glsl_to_tgsi.cpp
> index 74c1932..0c582f5 100644
> --- a/src/mesa/state_tracker/st_glsl_to_tgsi.cpp
> +++ b/src/mesa/state_tracker/st_glsl_to_tgsi.cpp
> @@ -5736,6 +5736,7 @@ get_mesa_program(struct gl_context *ctx,
>      */
>     _mesa_associate_uniform_storage(ctx, shader_program, prog->Parameters);
>     if (!shader_program->LinkStatus) {
> +      free_glsl_to_tgsi_visitor(v);
>        return NULL;
>     }
>  
> 

Huh, seems odd that st_program holds on to the visitor itself, rather
than some data structure produced by it.  But I guess it works...

This is clearly right, at any rate.

Reviewed-by: Kenneth Graunke <kenneth at whitecape.org>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: This is a digitally signed message part.
URL: <http://lists.freedesktop.org/archives/mesa-dev/attachments/20150517/a2e05f7d/attachment.sig>


More information about the mesa-dev mailing list