diff options
author | Grazvydas Ignotas <[email protected]> | 2016-01-21 01:52:24 +0200 |
---|---|---|
committer | Nicolai Hähnle <[email protected]> | 2016-01-21 15:36:24 -0500 |
commit | 0153ff8379be789262ad9cd636080d92b77becad (patch) | |
tree | 5e9cc3c5e90e941cdb7a9a7e2a36806df7833969 /src/gallium/drivers/r600 | |
parent | 739ac3d39dacdede853d150b9903001524453330 (diff) |
r600g: don't leak driver const buffers
The buffers are referenced from r600_update_driver_const_buffers()
-> r600_set_constant_buffer() -> u_upload_data(), but nothing
ever releases the reference. Similar case with driver_consts.
Found using valgrind.
Signed-off-by: Grazvydas Ignotas <[email protected]>
Cc: <[email protected]>
Reviewed-by: Nicolai Hähnle <[email protected]>
Diffstat (limited to 'src/gallium/drivers/r600')
-rw-r--r-- | src/gallium/drivers/r600/r600_pipe.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/src/gallium/drivers/r600/r600_pipe.c b/src/gallium/drivers/r600/r600_pipe.c index 08fdd361049..8abd60231f9 100644 --- a/src/gallium/drivers/r600/r600_pipe.c +++ b/src/gallium/drivers/r600/r600_pipe.c @@ -68,6 +68,7 @@ static const struct debug_named_value r600_debug_options[] = { static void r600_destroy_context(struct pipe_context *context) { struct r600_context *rctx = (struct r600_context *)context; + unsigned sh; r600_isa_destroy(rctx->isa); @@ -76,6 +77,11 @@ static void r600_destroy_context(struct pipe_context *context) pipe_resource_reference((struct pipe_resource**)&rctx->dummy_cmask, NULL); pipe_resource_reference((struct pipe_resource**)&rctx->dummy_fmask, NULL); + for (sh = 0; sh < PIPE_SHADER_TYPES; sh++) { + rctx->b.b.set_constant_buffer(&rctx->b.b, sh, R600_BUFFER_INFO_CONST_BUFFER, NULL); + free(rctx->driver_consts[sh].constants); + } + if (rctx->fixed_func_tcs_shader) rctx->b.b.delete_tcs_state(&rctx->b.b, rctx->fixed_func_tcs_shader); |