diff options
author | Marek Olšák <[email protected]> | 2011-08-30 17:11:34 +0200 |
---|---|---|
committer | Marek Olšák <[email protected]> | 2011-09-02 22:39:56 +0200 |
commit | 0a33ac5413d6217a30b70d4ec6e11389872616d0 (patch) | |
tree | 95a948a82b63b8d6d3346eb4e3bee757fa90086d | |
parent | 6862b54f4d4e88ef6ebf709ea7798093ec337e2a (diff) |
glsl_to_tgsi: fix more potential shader reference leaks
The last one has been pointed out by Ian.
-rw-r--r-- | src/mesa/state_tracker/st_glsl_to_tgsi.cpp | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/src/mesa/state_tracker/st_glsl_to_tgsi.cpp b/src/mesa/state_tracker/st_glsl_to_tgsi.cpp index 31750686e98..66fc00f8161 100644 --- a/src/mesa/state_tracker/st_glsl_to_tgsi.cpp +++ b/src/mesa/state_tracker/st_glsl_to_tgsi.cpp @@ -5078,21 +5078,31 @@ st_link_shader(struct gl_context *ctx, struct gl_shader_program *prog) (struct gl_vertex_program *)linked_prog); ok = ctx->Driver.ProgramStringNotify(ctx, GL_VERTEX_PROGRAM_ARB, linked_prog); + if (!ok) { + _mesa_reference_vertprog(ctx, &prog->VertexProgram, NULL); + } break; case GL_FRAGMENT_SHADER: _mesa_reference_fragprog(ctx, &prog->FragmentProgram, (struct gl_fragment_program *)linked_prog); ok = ctx->Driver.ProgramStringNotify(ctx, GL_FRAGMENT_PROGRAM_ARB, linked_prog); + if (!ok) { + _mesa_reference_fragprog(ctx, &prog->FragmentProgram, NULL); + } break; case GL_GEOMETRY_SHADER: _mesa_reference_geomprog(ctx, &prog->GeometryProgram, (struct gl_geometry_program *)linked_prog); ok = ctx->Driver.ProgramStringNotify(ctx, GL_GEOMETRY_PROGRAM_NV, linked_prog); + if (!ok) { + _mesa_reference_geomprog(ctx, &prog->GeometryProgram, NULL); + } break; } if (!ok) { + _mesa_reference_program(ctx, &prog->_LinkedShaders[i]->Program, NULL); _mesa_reference_program(ctx, &linked_prog, NULL); return GL_FALSE; } |