aboutsummaryrefslogtreecommitdiffstats
path: root/src/mesa/main/bufferobj.c
diff options
context:
space:
mode:
authorBrian Paul <[email protected]>2009-02-27 13:04:38 -0700
committerBrian Paul <[email protected]>2009-02-27 13:04:38 -0700
commita7f434b486187129ae8d5507170c42a9ce750258 (patch)
treee0378297abbb7ed865d1bd4b73669312d7ffa398 /src/mesa/main/bufferobj.c
parent395bcad8c095e78621e7aca18af1dab71fe69813 (diff)
mesa: if a buffer object is mapped when glDeleteBuffers() is called, unmap it
Diffstat (limited to 'src/mesa/main/bufferobj.c')
-rw-r--r--src/mesa/main/bufferobj.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/mesa/main/bufferobj.c b/src/mesa/main/bufferobj.c
index 1f41565fe2e..8df0a5b1a1e 100644
--- a/src/mesa/main/bufferobj.c
+++ b/src/mesa/main/bufferobj.c
@@ -793,6 +793,11 @@ _mesa_DeleteBuffersARB(GLsizei n, const GLuint *ids)
ASSERT(bufObj->Name == ids[i]);
+ if (bufObj->Pointer) {
+ /* if mapped, unmap it now */
+ ctx->Driver.UnmapBuffer(ctx, 0, bufObj);
+ }
+
/* unbind any vertex pointers bound to this buffer */
unbind(ctx, &ctx->Array.ArrayObj->Vertex.BufferObj, bufObj);
unbind(ctx, &ctx->Array.ArrayObj->Normal.BufferObj, bufObj);