fix program delete/refcount bug
authorBrian Paul <brian.paul@tungstengraphics.com>
Sun, 18 May 2008 22:37:35 +0000 (16:37 -0600)
committerBrian Paul <brian.paul@tungstengraphics.com>
Sun, 18 May 2008 22:37:35 +0000 (16:37 -0600)
src/mesa/state_tracker/st_cb_program.c

index a293ec3f0b99fc849b4825dc72f44118812186ef..3154fc85aa439da5f109b6fea99eb99b89b13e67 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);
@@ -169,6 +171,7 @@ st_delete_program(GLcontext *ctx, struct gl_program *prog)
       assert(0); /* problem */
    }
 
+   /* delete base class */
    _mesa_delete_program( ctx, prog );
 }