mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2025-12-26 15:00:10 +01:00
r600g: release query buffers in destroy_query
This fixes a memory leak introduced with the rework. Reviewed-by: Alex Deucher <alexander.deucher@amd.com> Reviewed-by: Christian König <christian.koenig@amd.com>
This commit is contained in:
parent
83667acfd9
commit
eabcecc26b
1 changed files with 9 additions and 0 deletions
|
|
@ -264,6 +264,15 @@ static struct pipe_query *r600_create_query(struct pipe_context *ctx, unsigned q
|
|||
static void r600_destroy_query(struct pipe_context *ctx, struct pipe_query *query)
|
||||
{
|
||||
struct r600_query *rquery = (struct r600_query*)query;
|
||||
struct r600_query_buffer *prev = rquery->buffer.previous;
|
||||
|
||||
/* Release all query buffers. */
|
||||
while (prev) {
|
||||
struct r600_query_buffer *qbuf = prev;
|
||||
prev = prev->previous;
|
||||
pipe_resource_reference((struct pipe_resource**)&qbuf->buf, NULL);
|
||||
FREE(qbuf);
|
||||
}
|
||||
|
||||
pipe_resource_reference((struct pipe_resource**)&rquery->buffer.buf, NULL);
|
||||
FREE(query);
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue