mesa: unmap buffer objects during context tear-down
authorBrian Paul <brianp@vmware.com>
Thu, 7 May 2009 15:36:21 +0000 (09:36 -0600)
committerBrian Paul <brianp@vmware.com>
Thu, 7 May 2009 15:36:21 +0000 (09:36 -0600)
src/mesa/main/shared.c

index 193ac8970cf7bd69a9e89ee42da4f498d1c85ed0..ae8dd2a83643abf79ec173c014d24c1e6a87177e 100644 (file)
@@ -190,6 +190,10 @@ delete_bufferobj_cb(GLuint id, void *data, void *userData)
 {
    struct gl_buffer_object *bufObj = (struct gl_buffer_object *) data;
    GLcontext *ctx = (GLcontext *) userData;
+   if (bufObj->Pointer) {
+      ctx->Driver.UnmapBuffer(ctx, 0, bufObj);
+      bufObj->Pointer = NULL;
+   }
    ctx->Driver.DeleteBuffer(ctx, bufObj);
 }