summaryrefslogtreecommitdiff
path: root/src/mesa/shader/shader_api.c
diff options
context:
space:
mode:
authorBrian Paul <brian.paul@tungstengraphics.com>2008-05-14 12:19:22 -0600
committerBrian Paul <brian.paul@tungstengraphics.com>2008-05-14 12:19:22 -0600
commitd791386b09682dbccc68cc3803b6d71a0362124e (patch)
treedb7a63cf5e823cadfe97f9c3ed0a9ee76a5b0874 /src/mesa/shader/shader_api.c
parent19f15277d1871b62902031f9fa9aabf2f1bc7c40 (diff)
fix some additional program refcounting bugs
cherry-picked from master
Diffstat (limited to 'src/mesa/shader/shader_api.c')
-rw-r--r--src/mesa/shader/shader_api.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/src/mesa/shader/shader_api.c b/src/mesa/shader/shader_api.c
index f12fa28d97..2b3dbff7a0 100644
--- a/src/mesa/shader/shader_api.c
+++ b/src/mesa/shader/shader_api.c
@@ -243,10 +243,8 @@ _mesa_free_shader(GLcontext *ctx, struct gl_shader *sh)
_mesa_free((void *) sh->Source);
if (sh->InfoLog)
_mesa_free(sh->InfoLog);
- for (i = 0; i < sh->NumPrograms; i++) {
- assert(sh->Programs[i]);
- ctx->Driver.DeleteProgram(ctx, sh->Programs[i]);
- }
+ for (i = 0; i < sh->NumPrograms; i++)
+ _mesa_reference_program(ctx, &sh->Programs[i], NULL);
if (sh->Programs)
_mesa_free(sh->Programs);
_mesa_free(sh);