Mesa (master): gallium/u_transfer_helper: Don't leak a reference to the resource.

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Fri Jun 28 18:34:56 UTC 2019


Module: Mesa
Branch: master
Commit: 65e0c4b64f6fbbab0e6a56d55d1d6c4baf875687
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=65e0c4b64f6fbbab0e6a56d55d1d6c4baf875687

Author: Kenneth Graunke <kenneth at whitecape.org>
Date:   Thu Jun 27 17:00:46 2019 -0700

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 <michel.daenzer at amd.com>

---

 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 {




More information about the mesa-commit mailing list