diff options
author | Marc-André Lureau <marcandre.lureau@redhat.com> | 2016-01-21 13:13:08 +0100 |
---|---|---|
committer | Dave Airlie <airlied@redhat.com> | 2016-02-10 12:39:47 +1000 |
commit | 595038e564c375b168f3a2ff43d1ba386dd9a5a2 (patch) | |
tree | ead57caebec629830b4c2e660891f9b8768812df | |
parent | 97ce5ea3f7c5e932ecf82943e23ca2b8b0dafa46 (diff) |
renderer: fix subcontext surface leaks
Fix leaks found thanks to AddressSanitizer.
Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
-rw-r--r-- | src/vrend_renderer.c | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/src/vrend_renderer.c b/src/vrend_renderer.c index bcb93f5..7ceb584 100644 --- a/src/vrend_renderer.c +++ b/src/vrend_renderer.c @@ -3828,6 +3828,15 @@ static void vrend_destroy_sub_context(struct vrend_sub_context *sub) sub->consts[i].consts = NULL; } + if (sub->zsurf) + vrend_surface_reference(&sub->zsurf, NULL); + + for (i = 0; i < sub->nr_cbufs; i++) { + if (!sub->surf[i]) + continue; + vrend_surface_reference(&sub->surf[i], NULL); + } + vrend_object_fini_ctx_table(sub->object_hash); vrend_clicbs->destroy_gl_context(sub->gl_context); |