summaryrefslogtreecommitdiff
path: root/src/mesa/shader/program.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/program.c
parent19f15277d1871b62902031f9fa9aabf2f1bc7c40 (diff)
fix some additional program refcounting bugs
cherry-picked from master
Diffstat (limited to 'src/mesa/shader/program.c')
-rw-r--r--src/mesa/shader/program.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/src/mesa/shader/program.c b/src/mesa/shader/program.c
index 9a23c5d7d3..e06ab5aa23 100644
--- a/src/mesa/shader/program.c
+++ b/src/mesa/shader/program.c
@@ -116,8 +116,6 @@ _mesa_free_program_data(GLcontext *ctx)
}
-
-
/**
* Set the vertex/fragment program error state (position and error string).
* This is generally called from within the parsers.
@@ -272,6 +270,7 @@ _mesa_delete_program(GLcontext *ctx, struct gl_program *prog)
{
(void) ctx;
ASSERT(prog);
+ ASSERT(prog->RefCount==0);
if (prog == &_mesa_DummyProgram)
return;
@@ -391,7 +390,7 @@ _mesa_clone_program(GLcontext *ctx, const struct gl_program *prog)
clone->Format = prog->Format;
clone->Instructions = _mesa_alloc_instructions(prog->NumInstructions);
if (!clone->Instructions) {
- ctx->Driver.DeleteProgram(ctx, clone);
+ _mesa_reference_program(ctx, &clone, NULL);
return NULL;
}
_mesa_copy_instructions(clone->Instructions, prog->Instructions,