summaryrefslogtreecommitdiffstats
path: root/src/mesa
diff options
context:
space:
mode:
authorBrian Paul <[email protected]>2008-05-14 16:44:08 -0600
committerBrian Paul <[email protected]>2008-05-14 16:44:08 -0600
commit887bfee6e3beeacb441b81ac225d99060d4b5dfc (patch)
treefe17f2e2c07bb4d47fe40660b3c69f8f2667ceab /src/mesa
parent23db6287d41494799a4d171bae628b0d2e9baf36 (diff)
mesa: fix InfoLog memleak, misc sync with master
Diffstat (limited to 'src/mesa')
-rw-r--r--src/mesa/shader/shader_api.c12
1 files changed, 8 insertions, 4 deletions
diff --git a/src/mesa/shader/shader_api.c b/src/mesa/shader/shader_api.c
index d0512b8ed1d..badc457c1c0 100644
--- a/src/mesa/shader/shader_api.c
+++ b/src/mesa/shader/shader_api.c
@@ -126,10 +126,17 @@ _mesa_free_shader_program_data(GLcontext *ctx,
for (i = 0; i < shProg->NumShaders; i++) {
_mesa_reference_shader(ctx, &shProg->Shaders[i], NULL);
}
+ shProg->NumShaders = 0;
+
if (shProg->Shaders) {
_mesa_free(shProg->Shaders);
shProg->Shaders = NULL;
}
+
+ if (shProg->InfoLog) {
+ _mesa_free(shProg->InfoLog);
+ shProg->InfoLog = NULL;
+ }
}
@@ -140,10 +147,7 @@ void
_mesa_free_shader_program(GLcontext *ctx, struct gl_shader_program *shProg)
{
_mesa_free_shader_program_data(ctx, shProg);
- if (shProg->Shaders) {
- _mesa_free(shProg->Shaders);
- shProg->Shaders = NULL;
- }
+
_mesa_free(shProg);
}