mesa: Don't attempt to free the dummy program.
authorJosé Fonseca <jfonseca@vmware.com>
Wed, 8 Apr 2009 10:32:43 +0000 (11:32 +0100)
committerJosé Fonseca <jfonseca@vmware.com>
Wed, 8 Apr 2009 10:32:43 +0000 (11:32 +0100)
src/mesa/main/shared.c

index fa45e466b7ff30a71583e65a9b884f496a1124d9..193ac8970cf7bd69a9e89ee42da4f498d1c85ed0 100644 (file)
@@ -159,9 +159,11 @@ delete_program_cb(GLuint id, void *data, void *userData)
 {
    struct gl_program *prog = (struct gl_program *) data;
    GLcontext *ctx = (GLcontext *) userData;
-   ASSERT(prog->RefCount == 1); /* should only be referenced by hash table */
-   prog->RefCount = 0;  /* now going away */
-   ctx->Driver.DeleteProgram(ctx, prog);
+   if(prog != &_mesa_DummyProgram) {
+      ASSERT(prog->RefCount == 1); /* should only be referenced by hash table */
+      prog->RefCount = 0;  /* now going away */
+      ctx->Driver.DeleteProgram(ctx, prog);
+   }
 }