gallium: implement full reference counting for vertex/fragment programs

Use _mesa_reference_vert/fragprog() wherever we assign program pointers.
Fixes a memory corruption bug found with glean/api2 test.
Another memory bug involving shaders yet to be fixed...

Picked from gallium-0.1
This commit is contained in:
Brian Paul
2008-05-07 08:55:33 -06:00
parent 10b7192747
commit a56a59ce74
11 changed files with 170 additions and 74 deletions

View File

@@ -158,6 +158,9 @@ static void st_destroy_context_priv( struct st_context *st )
{
uint i;
st_reference_fragprog(st, &st->fp, NULL);
st_reference_vertprog(st, &st->vp, NULL);
draw_destroy(st->draw);
st_destroy_atoms( st );
st_destroy_draw( st );