This makes piglit mixing-clip-distance-and-clip-vertex-disallowed have 0
definitely lost blocks with valgrind. (Same non-0 number of possibly
lost blocks though.)
Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Reviewed-by: Tobias Klausmann <tobias.johannes.klausmann@mni.thm.de>
Cc: "10.5 10.6" <mesa-stable@lists.freedesktop.org>
link_intrastage_shaders(mem_ctx, ctx, prog, shader_list[stage],
num_shaders[stage]);
- if (!prog->LinkStatus)
+ if (!prog->LinkStatus) {
+ if (sh)
+ ctx->Driver.DeleteShader(ctx, sh);
goto done;
+ }
switch (stage) {
case MESA_SHADER_VERTEX:
validate_fragment_shader_executable(prog, sh);
break;
}
- if (!prog->LinkStatus)
+ if (!prog->LinkStatus) {
+ if (sh)
+ ctx->Driver.DeleteShader(ctx, sh);
goto done;
+ }
_mesa_reference_shader(ctx, &prog->_LinkedShaders[stage], sh);
}