summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBrian <[email protected]>2007-08-13 17:37:45 +0100
committerBrian <[email protected]>2007-08-13 17:39:05 +0100
commitf6696cc15ea60308f4c8c0397ce7c5795049a42d (patch)
treea3bc0f14ad16689413ce8a16dc94293efdd16ae4
parentfef9a41fe4bbdd9bed0443b6d5b96f7b6c0826b4 (diff)
free any render/framebuffers left in hash tables when freeing shared state
-rw-r--r--src/mesa/main/context.c23
1 files changed, 23 insertions, 0 deletions
diff --git a/src/mesa/main/context.c b/src/mesa/main/context.c
index cf358f1d839..ee59f0e4664 100644
--- a/src/mesa/main/context.c
+++ b/src/mesa/main/context.c
@@ -628,6 +628,27 @@ delete_shader_cb(GLuint id, void *data, void *userData)
}
}
+/**
+ * Callback for deleting a framebuffer object. Called by _mesa_HashDeleteAll()
+ */
+static void
+delete_framebuffer_cb(GLuint id, void *data, void *userData)
+{
+ struct gl_framebuffer *fb = (struct gl_framebuffer *) data;
+ fb->Delete(fb);
+}
+
+/**
+ * Callback for deleting a renderbuffer object. Called by _mesa_HashDeleteAll()
+ */
+static void
+delete_renderbuffer_cb(GLuint id, void *data, void *userData)
+{
+ struct gl_renderbuffer *rb = (struct gl_renderbuffer *) data;
+ rb->Delete(rb);
+}
+
+
/**
* Deallocate a shared state object and all children structures.
@@ -695,7 +716,9 @@ free_shared_state( GLcontext *ctx, struct gl_shared_state *ss )
#endif
#if FEATURE_EXT_framebuffer_object
+ _mesa_HashDeleteAll(ss->FrameBuffers, delete_framebuffer_cb, ctx);
_mesa_DeleteHashTable(ss->FrameBuffers);
+ _mesa_HashDeleteAll(ss->RenderBuffers, delete_renderbuffer_cb, ctx);
_mesa_DeleteHashTable(ss->RenderBuffers);
#endif