r600g: fixed bo memory leak issue
authorPierre-Eric Pelloux-Prayer <pelloux@gmail.com>
Fri, 10 Jun 2011 11:57:21 +0000 (13:57 +0200)
committerAlex Deucher <alexdeucher@gmail.com>
Mon, 13 Jun 2011 14:47:07 +0000 (10:47 -0400)
pipe_resource_reference call was miossing, thus creating massive memory under certain conditions.
Fix : https://bugs.freedesktop.org/show_bug.cgi?id=37168

src/gallium/drivers/r600/r600_translate.c

index 7482d15e12fb629a5cd152fa096bfaa27a3d8646..307fd57e21ac674d5cf62716bc90457b721d8881 100644 (file)
@@ -48,6 +48,7 @@ void r600_translate_index_buffer(struct r600_pipe_context *r600,
                                &r600->context, *index_buffer, 0, *start, count, ptr);
 
                pipe_resource_reference(index_buffer, out_buffer);
+               pipe_resource_reference(&out_buffer, NULL);
                *index_size = 2;
                *start = out_offset / 2;
                break;