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@amd.com>
This commit is contained in:
Kenneth Graunke 2019-06-27 17:00:46 -07:00
parent 6227e6faee
commit 65e0c4b64f

View file

@ -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 {