fix program delete/refcount bug
authorBrian Paul <brian.paul@tungstengraphics.com>
Mon, 19 May 2008 15:04:02 +0000 (09:04 -0600)
committerBrian Paul <brian.paul@tungstengraphics.com>
Mon, 19 May 2008 15:04:02 +0000 (09:04 -0600)
cherry-picked from gallium-tex-surfaces

src/mesa/state_tracker/st_cb_program.c

index a293ec3f0b99fc849b4825dc72f44118812186ef..b23e000a0b079b3bd670f9f80242b8e7559d8ee2 100644 (file)
@@ -159,7 +159,9 @@ st_delete_program(GLcontext *ctx, struct gl_program *prog)
          }
 
          if (stfp->bitmap_program) {
-            st_delete_program(ctx, &stfp->bitmap_program->Base.Base);
+            struct gl_program *prg = &stfp->bitmap_program->Base.Base;
+            _mesa_reference_program(ctx, &prg, NULL);
+            stfp->bitmap_program = NULL;
          }
 
          st_free_translated_vertex_programs(st, stfp->vertex_programs);