summaryrefslogtreecommitdiffstats
path: root/src/mesa/main
diff options
context:
space:
mode:
authorEric Anholt <[email protected]>2010-11-05 07:23:45 -0700
committerEric Anholt <[email protected]>2011-03-11 12:55:13 -0800
commit9c7231c1d9cda244444dbfa05f15ead1bf581dc3 (patch)
treed3c83ed8bb4a220803db8941d848d3f0046fb0e7 /src/mesa/main
parent5ae1d195061b5f01d85b8f6d48d89d7995b07f4f (diff)
mesa: Don't try to remove an internal shader_program from the hash.
It fails on assertions if the key isn't actually present.
Diffstat (limited to 'src/mesa/main')
-rw-r--r--src/mesa/main/shaderobj.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/mesa/main/shaderobj.c b/src/mesa/main/shaderobj.c
index 1d75845590f..62de23bd100 100644
--- a/src/mesa/main/shaderobj.c
+++ b/src/mesa/main/shaderobj.c
@@ -72,7 +72,8 @@ _mesa_reference_shader(struct gl_context *ctx, struct gl_shader **ptr,
deleteFlag = (old->RefCount == 0);
if (deleteFlag) {
- _mesa_HashRemove(ctx->Shared->ShaderObjects, old->Name);
+ if (old->Name != 0)
+ _mesa_HashRemove(ctx->Shared->ShaderObjects, old->Name);
ctx->Driver.DeleteShader(ctx, old);
}
@@ -213,7 +214,8 @@ _mesa_reference_shader_program(struct gl_context *ctx,
deleteFlag = (old->RefCount == 0);
if (deleteFlag) {
- _mesa_HashRemove(ctx->Shared->ShaderObjects, old->Name);
+ if (old->Name != 0)
+ _mesa_HashRemove(ctx->Shared->ShaderObjects, old->Name);
ctx->Driver.DeleteShaderProgram(ctx, old);
}