Module: Mesa
Branch: master
Commit: 629700ed7eaaf63d2037a11b2931c91fdc22944a
URL:    
http://cgit.freedesktop.org/mesa/mesa/commit/?id=629700ed7eaaf63d2037a11b2931c91fdc22944a

Author: José Fonseca <jfons...@vmware.com>
Date:   Wed Apr  8 11:32:43 2009 +0100

mesa: Don't attempt to free the dummy program.

---

 src/mesa/main/shared.c |    8 +++++---
 1 files changed, 5 insertions(+), 3 deletions(-)

diff --git a/src/mesa/main/shared.c b/src/mesa/main/shared.c
index fa45e46..193ac89 100644
--- a/src/mesa/main/shared.c
+++ b/src/mesa/main/shared.c
@@ -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);
+   }
 }
 
 

_______________________________________________
mesa-commit mailing list
mesa-commit@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/mesa-commit

Reply via email to