diff options
author | Brian <brian@yutani.localnet.net> | 2007-03-15 16:07:39 -0600 |
---|---|---|
committer | Brian <brian@yutani.localnet.net> | 2007-03-15 16:07:39 -0600 |
commit | e348016253582e6a31f7ee7149ff4999de33642d (patch) | |
tree | 5f15ce20058feb620c6a0a067d25e21c0ae84907 /src/mesa/main | |
parent | 7ed292a4e946fe43b04dd76d5f26df4e70765788 (diff) |
silently ignore DeleteProgram/Shader(id=0)
Diffstat (limited to 'src/mesa/main')
-rw-r--r-- | src/mesa/main/shaders.c | 32 |
1 files changed, 19 insertions, 13 deletions
diff --git a/src/mesa/main/shaders.c b/src/mesa/main/shaders.c index 4c8ba47bcb..58be1f46e5 100644 --- a/src/mesa/main/shaders.c +++ b/src/mesa/main/shaders.c @@ -110,15 +110,17 @@ _mesa_CreateProgramObjectARB(void) void GLAPIENTRY _mesa_DeleteObjectARB(GLhandleARB obj) { - GET_CURRENT_CONTEXT(ctx); - if (ctx->Driver.IsProgram(ctx, obj)) { - ctx->Driver.DeleteProgram2(ctx, obj); - } - else if (ctx->Driver.IsShader(ctx, obj)) { - ctx->Driver.DeleteShader(ctx, obj); - } - else { - /* error? */ + if (obj) { + GET_CURRENT_CONTEXT(ctx); + if (ctx->Driver.IsProgram(ctx, obj)) { + ctx->Driver.DeleteProgram2(ctx, obj); + } + else if (ctx->Driver.IsShader(ctx, obj)) { + ctx->Driver.DeleteShader(ctx, obj); + } + else { + /* error? */ + } } } @@ -126,16 +128,20 @@ _mesa_DeleteObjectARB(GLhandleARB obj) void GLAPIENTRY _mesa_DeleteProgram(GLuint name) { - GET_CURRENT_CONTEXT(ctx); - ctx->Driver.DeleteProgram2(ctx, name); + if (name) { + GET_CURRENT_CONTEXT(ctx); + ctx->Driver.DeleteProgram2(ctx, name); + } } void GLAPIENTRY _mesa_DeleteShader(GLuint name) { - GET_CURRENT_CONTEXT(ctx); - ctx->Driver.DeleteShader(ctx, name); + if (name) { + GET_CURRENT_CONTEXT(ctx); + ctx->Driver.DeleteShader(ctx, name); + } } |