summaryrefslogtreecommitdiffstats
path: root/src/mesa/main
diff options
context:
space:
mode:
authorBrian Paul <[email protected]>2004-09-14 22:28:27 +0000
committerBrian Paul <[email protected]>2004-09-14 22:28:27 +0000
commit765f1a12c6256282fe175ec92a0d01b45e4322c7 (patch)
tree0f338633fea0bcf7f84abecb201f83949602d87e /src/mesa/main
parent8de924dbb0447579fa455c94a1e410c69e5ce4b5 (diff)
also fix possible delete bugs with buffer objects and vertex/fragment programs
Diffstat (limited to 'src/mesa/main')
-rw-r--r--src/mesa/main/bufferobj.c9
-rw-r--r--src/mesa/main/mtypes.h7
2 files changed, 10 insertions, 6 deletions
diff --git a/src/mesa/main/bufferobj.c b/src/mesa/main/bufferobj.c
index 998228e8008..84af8158ad2 100644
--- a/src/mesa/main/bufferobj.c
+++ b/src/mesa/main/bufferobj.c
@@ -1,6 +1,6 @@
/*
* Mesa 3-D graphics library
- * Version: 6.1
+ * Version: 6.2
*
* Copyright (C) 1999-2004 Brian Paul All Rights Reserved.
*
@@ -592,8 +592,11 @@ _mesa_DeleteBuffersARB(GLsizei n, const GLuint *ids)
}
/* decrement refcount and delete if <= 0 */
- bufObj->DeletePending = GL_TRUE;
- bufObj->RefCount--;
+ if (!bufObj->DeletePending) {
+ bufObj->DeletePending = GL_TRUE;
+ bufObj->RefCount--;
+ }
+
if (bufObj->RefCount <= 0) {
/* buffer should not be bound anymore! */
ASSERT(ctx->Array.ArrayBufferObj != bufObj);
diff --git a/src/mesa/main/mtypes.h b/src/mesa/main/mtypes.h
index 3e5c04415d2..be6882f203f 100644
--- a/src/mesa/main/mtypes.h
+++ b/src/mesa/main/mtypes.h
@@ -1574,10 +1574,11 @@ struct program_parameter_list;
struct program
{
GLuint Id;
- GLubyte *String; /* Null-terminated program text */
- GLenum Target;
- GLenum Format; /* String encoding format */
+ GLubyte *String; /**< Null-terminated program text */
+ GLboolean DeletePending; /**< User called glDeletePrograms? */
GLint RefCount;
+ GLenum Target;
+ GLenum Format; /**< String encoding format */
GLboolean Resident;
GLfloat LocalParams[MAX_PROGRAM_LOCAL_PARAMS][4];
GLuint NumInstructions; /* GL_ARB_vertex/fragment_program */