From 65e0c4b64f6fbbab0e6a56d55d1d6c4baf875687 Mon Sep 17 00:00:00 2001 From: Kenneth Graunke Date: Thu, 27 Jun 2019 17:00:46 -0700 Subject: [PATCH] gallium/u_transfer_helper: Don't leak a reference to the resource. MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit We pipe_resource_reference when handling transfers in map, we need to do a corresponding unreference in unmap. Reviewed-by: Michel Dänzer --- src/gallium/auxiliary/util/u_transfer_helper.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/gallium/auxiliary/util/u_transfer_helper.c b/src/gallium/auxiliary/util/u_transfer_helper.c index b7bd43fd97f..033a49b14e2 100644 --- a/src/gallium/auxiliary/util/u_transfer_helper.c +++ b/src/gallium/auxiliary/util/u_transfer_helper.c @@ -511,6 +511,8 @@ u_transfer_helper_transfer_unmap(struct pipe_context *pctx, helper->vtbl->transfer_unmap(pctx, trans->trans2); } + pipe_resource_reference(&ptrans->resource, NULL); + free(trans->staging); free(trans); } else { -- 2.30.2