diff options
author | Marc-André Lureau <marcandre.lureau@redhat.com> | 2016-01-21 15:10:21 +0100 |
---|---|---|
committer | Dave Airlie <airlied@redhat.com> | 2016-02-10 12:39:47 +1000 |
commit | 1e67b391cce1d8c8f51b0dde6a2f5fe673c547db (patch) | |
tree | dda7f566bec13a08b508d8d616fbfe7c631381ff | |
parent | 595038e564c375b168f3a2ff43d1ba386dd9a5a2 (diff) |
renderer: fix sampler views leaks
Fix found thanks to AddressSanitizer.
Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
-rw-r--r-- | src/vrend_renderer.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/src/vrend_renderer.c b/src/vrend_renderer.c index 7ceb584..9bff79a 100644 --- a/src/vrend_renderer.c +++ b/src/vrend_renderer.c @@ -3789,7 +3789,7 @@ vrend_renderer_fini(void) static void vrend_destroy_sub_context(struct vrend_sub_context *sub) { - int i; + int i, j; struct vrend_streamout_object *obj, *tmp; if (sub->fb_id) @@ -3826,6 +3826,10 @@ static void vrend_destroy_sub_context(struct vrend_sub_context *sub) for (i = 0; i < PIPE_SHADER_TYPES; i++) { free(sub->consts[i].consts); sub->consts[i].consts = NULL; + + for (j = 0; j < PIPE_MAX_SHADER_SAMPLER_VIEWS; j++) { + vrend_sampler_view_reference(&sub->views[i].views[j], NULL); + } } if (sub->zsurf) |