summaryrefslogtreecommitdiffstats
path: root/src/mesa/drivers
diff options
context:
space:
mode:
authorZou Nan hai <[email protected]>2007-09-18 11:32:25 +0800
committerZou Nan hai <[email protected]>2007-09-18 11:32:25 +0800
commit25bda451bbdbc51a7a4346e2c809f335fb46db72 (patch)
treeccd36f731779b084f5a33a7eb59ffce963d53741 /src/mesa/drivers
parentc702a7100e2aa83241e89850a97bcc23e1c6fedb (diff)
fix double free in 965-glsl branch
Diffstat (limited to 'src/mesa/drivers')
-rw-r--r--src/mesa/drivers/dri/i965/brw_vs_emit.c2
-rw-r--r--src/mesa/drivers/dri/i965/brw_wm_glsl.c2
-rw-r--r--src/mesa/drivers/dri/i965/intel_context.c2
3 files changed, 6 insertions, 0 deletions
diff --git a/src/mesa/drivers/dri/i965/brw_vs_emit.c b/src/mesa/drivers/dri/i965/brw_vs_emit.c
index 18ede5f6cdc..f689f7b3050 100644
--- a/src/mesa/drivers/dri/i965/brw_vs_emit.c
+++ b/src/mesa/drivers/dri/i965/brw_vs_emit.c
@@ -1173,4 +1173,6 @@ void brw_vs_emit(struct brw_vs_compile *c )
end_inst = &p->store[p->nr_insn];
emit_vertex_write(c);
post_vs_emit(c, end_inst);
+ for (insn = 0; insn < nr_insns; insn++)
+ c->vp->program.Base.Instructions[insn].Data = NULL;
}
diff --git a/src/mesa/drivers/dri/i965/brw_wm_glsl.c b/src/mesa/drivers/dri/i965/brw_wm_glsl.c
index f47f139282d..f03866d9b93 100644
--- a/src/mesa/drivers/dri/i965/brw_wm_glsl.c
+++ b/src/mesa/drivers/dri/i965/brw_wm_glsl.c
@@ -1246,6 +1246,8 @@ static void brw_wm_emit_glsl(struct brw_wm_compile *c)
}
}
post_wm_emit(c);
+ for (i = 0; i < c->fp->program.Base.NumInstructions; i++)
+ c->fp->program.Base.Instructions[i].Data = NULL;
}
void brw_wm_glsl_emit(struct brw_wm_compile *c)
diff --git a/src/mesa/drivers/dri/i965/intel_context.c b/src/mesa/drivers/dri/i965/intel_context.c
index 3215cc7218a..35babcac233 100644
--- a/src/mesa/drivers/dri/i965/intel_context.c
+++ b/src/mesa/drivers/dri/i965/intel_context.c
@@ -555,6 +555,8 @@ void intelDestroyContext(__DRIcontextPrivate *driContextPriv)
#endif
/* free the Mesa context */
+ intel->ctx.VertexProgram.Current = NULL;
+ intel->ctx.FragmentProgram.Current = NULL;
_mesa_destroy_context(&intel->ctx);
}