From: Kenneth Graunke Date: Fri, 28 Jun 2019 00:00:46 +0000 (-0700) Subject: gallium/u_transfer_helper: Don't leak a reference to the resource. X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=65e0c4b64f6fbbab0e6a56d55d1d6c4baf875687;p=mesa.git gallium/u_transfer_helper: Don't leak a reference to the resource. We pipe_resource_reference when handling transfers in map, we need to do a corresponding unreference in unmap. Reviewed-by: Michel Dänzer --- 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 {