summaryrefslogtreecommitdiff
path: root/src/mesa/shader
diff options
context:
space:
mode:
authorXiang, Haihao <haihao.xiang@intel.com>2008-03-31 17:02:47 +0800
committerXiang, Haihao <haihao.xiang@intel.com>2008-03-31 17:17:34 +0800
commit63d8a8417d68365cd10c11178516378411c09f87 (patch)
tree5c3fb18383b153be5b17b1f8f2c461c218ee1318 /src/mesa/shader
parentaef47c4dc87075fd63002b50c4b32b1049e5e4d1 (diff)
mesa: Free all shader program data before deleting all
shader/shader program objects to avoid memory access error.
Diffstat (limited to 'src/mesa/shader')
-rw-r--r--src/mesa/shader/shader_api.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/mesa/shader/shader_api.c b/src/mesa/shader/shader_api.c
index df2f9dcec8..01a237c525 100644
--- a/src/mesa/shader/shader_api.c
+++ b/src/mesa/shader/shader_api.c
@@ -127,6 +127,8 @@ _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;