From a6f6d6188c977757695c16d044183db1256d029e Mon Sep 17 00:00:00 2001 From: Eric Anholt Date: Tue, 30 Dec 2014 15:39:20 -0800 Subject: [PATCH] u_primconvert: Fix leak of the upload BO on context destroy. v2: Conditionalize it on having done any uploads (Turns out u_upload_destroy() isn't safe with a NULL arg). Reviewed-by: Dave Airlie (v1) --- src/gallium/auxiliary/indices/u_primconvert.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/gallium/auxiliary/indices/u_primconvert.c b/src/gallium/auxiliary/indices/u_primconvert.c index eba1f9e..cebb818 100644 --- a/src/gallium/auxiliary/indices/u_primconvert.c +++ b/src/gallium/auxiliary/indices/u_primconvert.c @@ -74,6 +74,8 @@ util_primconvert_create(struct pipe_context *pipe, uint32_t primtypes_mask) void util_primconvert_destroy(struct primconvert_context *pc) { + if (pc->upload) + u_upload_destroy(pc->upload); util_primconvert_save_index_buffer(pc, NULL); FREE(pc); } -- 2.7.4