mesa/main: Free ctx->DrawIndirectBuffer during teardown
authorAaron Watry <awatry@gmail.com>
Thu, 2 Jan 2014 17:18:09 +0000 (11:18 -0600)
committerAaron Watry <awatry@gmail.com>
Thu, 16 Jan 2014 16:10:04 +0000 (10:10 -0600)
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

Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Reviewed-by: Chris Forbes <chrisf@ijw.co.nz>
src/mesa/main/bufferobj.c

index a3d8f24b149db98d006f8a42a84babb85a487d3c..93367590aac15181a104f3ed990181f86ea8357c 100644 (file)
@@ -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,