summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEric Anholt <[email protected]>2014-12-30 15:39:20 -0800
committerEric Anholt <[email protected]>2014-12-31 13:50:17 -0800
commita6f6d6188c977757695c16d044183db1256d029e (patch)
treecc5b908c8d1a2ee7cf6094c96a71c65d4f66ef63
parent37478c638a3607295437ce0a41dae03c200948f4 (diff)
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 <[email protected]> (v1)
-rw-r--r--src/gallium/auxiliary/indices/u_primconvert.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/gallium/auxiliary/indices/u_primconvert.c b/src/gallium/auxiliary/indices/u_primconvert.c
index eba1f9e4b30..cebb81842d1 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);
}