diff options
author | Eric Anholt <[email protected]> | 2014-09-15 12:19:28 -0700 |
---|---|---|
committer | Eric Anholt <[email protected]> | 2014-09-15 13:12:27 -0700 |
commit | 2147dd96813d1faee5c55e84b332355ad05f070a (patch) | |
tree | 6d81af7f4403dfc23e352c7de621b33dd6a80713 /src/gallium/drivers/vc4/vc4_qir.c | |
parent | f78ee1b280c82d525370cc378467276584acf0c8 (diff) |
vc4: Fix memory leaks of struct qinst.
Diffstat (limited to 'src/gallium/drivers/vc4/vc4_qir.c')
-rw-r--r-- | src/gallium/drivers/vc4/vc4_qir.c | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/src/gallium/drivers/vc4/vc4_qir.c b/src/gallium/drivers/vc4/vc4_qir.c index 60455d50f86..0ab81d4d714 100644 --- a/src/gallium/drivers/vc4/vc4_qir.c +++ b/src/gallium/drivers/vc4/vc4_qir.c @@ -283,8 +283,22 @@ qir_compile_init(void) } void +qir_remove_instruction(struct qinst *qinst) +{ + remove_from_list(&qinst->link); + free(qinst->src); + free(qinst); +} + +void qir_compile_destroy(struct vc4_compile *c) { + while (!is_empty_list(&c->instructions)) { + struct qinst *qinst = + (struct qinst *)first_elem(&c->instructions); + qir_remove_instruction(qinst); + } + ralloc_free(c); } |