summaryrefslogtreecommitdiff
path: root/src/mesa/main/context.c
diff options
context:
space:
mode:
authorTilman Sauerbeck <tilman@freedesktop.org>2006-06-29 18:36:51 +0000
committerTilman Sauerbeck <tilman@freedesktop.org>2006-06-29 18:36:51 +0000
commitf7f5b2c41516b11204ff2f253a822b3ac35dcbe0 (patch)
tree7330e5c3ca040bf8e9b3b37d5ea7957bc6413f0f /src/mesa/main/context.c
parentff3a5b1842bf26783a487674c5ff4cb40f405f25 (diff)
destroy left-over VBOs on shutdown
Diffstat (limited to 'src/mesa/main/context.c')
-rw-r--r--src/mesa/main/context.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/src/mesa/main/context.c b/src/mesa/main/context.c
index 08020dbac8..40112ff828 100644
--- a/src/mesa/main/context.c
+++ b/src/mesa/main/context.c
@@ -888,6 +888,20 @@ free_shared_state( GLcontext *ctx, struct gl_shared_state *ss )
#endif
#if FEATURE_ARB_vertex_buffer_object
+ /* Free vertex buffer objects */
+ while (1) {
+ GLuint name = _mesa_HashFirstEntry(ss->BufferObjects);
+ if (name) {
+ struct gl_buffer_object *bufObj = (struct gl_buffer_object *)
+ _mesa_HashLookup(ss->BufferObjects, name);
+ ASSERT(bufObj);
+ ctx->Driver.DeleteBuffer(ctx, bufObj);
+ _mesa_HashRemove(ss->BufferObjects, name);
+ }
+ else {
+ break;
+ }
+ }
_mesa_DeleteHashTable(ss->BufferObjects);
#endif