[Mesa-stable] [PATCH 3/3] mesa/main: Free ctx->DrawIndirectBuffer during teardown

Aaron Watry awatry at gmail.com
Fri Jan 10 16:45:52 PST 2014


ctx->DrawIndirectBuffer wasn't being free'd in _mesa_free_buffer_objects

With this patch, "valgrind --leak-check=full glxgears" on evergreen (CEDAR)
now shows:

LEAK SUMMARY:
   definitely lost: 0 bytes in 0 blocks
   indirectly lost: 0 bytes in 0 blocks
     possibly lost: 0 bytes in 0 blocks
   still reachable: 70,228 bytes in 651 blocks
        suppressed: 0 bytes in 0 blocks

CC: "10.0" <mesa-stable at lists.freedesktop.org>
Reviewed-by: Brian Paul <brianp at vmware.com>
Reviewed-by: Marek Olšák <marek.olsak at amd.com>
---
 src/mesa/main/bufferobj.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/src/mesa/main/bufferobj.c b/src/mesa/main/bufferobj.c
index a3d8f24..9336759 100644
--- a/src/mesa/main/bufferobj.c
+++ b/src/mesa/main/bufferobj.c
@@ -871,6 +871,8 @@ _mesa_free_buffer_objects( struct gl_context *ctx )
 
    _mesa_reference_buffer_object(ctx, &ctx->UniformBuffer, NULL);
 
+   _mesa_reference_buffer_object(ctx, &ctx->DrawIndirectBuffer, NULL);
+
    for (i = 0; i < MAX_COMBINED_UNIFORM_BUFFERS; i++) {
       _mesa_reference_buffer_object(ctx,
 				    &ctx->UniformBufferBindings[i].BufferObject,
-- 
1.8.3.2



More information about the mesa-stable mailing list