mesa: release VBO and PBO references upon context destruction
authorBrian Paul <brianp@vmware.com>
Tue, 2 Jun 2009 16:27:05 +0000 (10:27 -0600)
committerBrian Paul <brianp@vmware.com>
Tue, 2 Jun 2009 16:29:39 +0000 (10:29 -0600)
src/mesa/main/context.c

index 884b6ad2829b398f8846c373e80d2104a39ac470..a947f69632f308b67fe05af42afb5ab0213b8bc4 100644 (file)
@@ -1007,6 +1007,16 @@ _mesa_free_context_data( GLcontext *ctx )
 
    _mesa_delete_array_object(ctx, ctx->Array.DefaultArrayObj);
 
+#if FEATURE_ARB_pixel_buffer_object
+   _mesa_reference_buffer_object(ctx, &ctx->Pack.BufferObj, NULL);
+   _mesa_reference_buffer_object(ctx, &ctx->Unpack.BufferObj, NULL);
+#endif
+
+#if FEATURE_ARB_vertex_buffer_object
+   _mesa_reference_buffer_object(ctx, &ctx->Array.ArrayBufferObj, NULL);
+   _mesa_reference_buffer_object(ctx, &ctx->Array.ElementArrayBufferObj, NULL);
+#endif
+
 #if FEATURE_ARB_vertex_buffer_object
    _mesa_delete_buffer_object(ctx, ctx->Array.NullBufferObj);
 #endif