Mesa (master): i965/gen4: Fix memory leak each time compile_gs_prog() is called.

Eric Anholt anholt at kemper.freedesktop.org
Mon Nov 26 07:28:24 UTC 2012


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

Author: Eric Anholt <eric at anholt.net>
Date:   Fri Nov 16 09:56:03 2012 -0800

i965/gen4: Fix memory leak each time compile_gs_prog() is called.

Commit 774fb90db3e83d5e7326b7a72e05ce805c306b24 introduced a ralloc context to
each user of struct brw_compile, but for this one a NULL context was used,
causing the later ralloc_free(mem_ctx) to not do anything.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=55175
NOTE: This is a candidate for the stable branches.

---

 src/mesa/drivers/dri/i965/brw_gs.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/src/mesa/drivers/dri/i965/brw_gs.c b/src/mesa/drivers/dri/i965/brw_gs.c
index 52742d0..9ba53ec 100644
--- a/src/mesa/drivers/dri/i965/brw_gs.c
+++ b/src/mesa/drivers/dri/i965/brw_gs.c
@@ -59,7 +59,7 @@ static void compile_gs_prog( struct brw_context *brw,
    c.vue_map = brw->vs.prog_data->vue_map;
    c.nr_regs = (c.vue_map.num_slots + 1)/2;
 
-   mem_ctx = NULL;
+   mem_ctx = ralloc_context(NULL);
    
    /* Begin the compilation:
     */




More information about the mesa-commit mailing list