fix double free in 965-glsl branch

This commit is contained in:
Zou Nan hai 2007-09-18 11:32:25 +08:00
parent c702a7100e
commit 25bda451bb
3 changed files with 6 additions and 0 deletions

View file

@ -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;
}

View file

@ -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)

View file

@ -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);
}