[Mesa-dev] [PATCH 07/17] i965: Free serialized nir after deserializing

Jordan Justen jordan.l.justen at intel.com
Thu Nov 9 06:42:19 UTC 2017


Signed-off-by: Jordan Justen <jordan.l.justen at intel.com>
---
 src/mesa/drivers/dri/i965/brw_program.c | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/src/mesa/drivers/dri/i965/brw_program.c b/src/mesa/drivers/dri/i965/brw_program.c
index 39308f306df..809766574f8 100644
--- a/src/mesa/drivers/dri/i965/brw_program.c
+++ b/src/mesa/drivers/dri/i965/brw_program.c
@@ -794,4 +794,10 @@ brw_program_deserialize_nir(struct gl_context *ctx, struct gl_program *prog,
                        prog->driver_cache_blob_size);
       prog->nir = nir_deserialize(NULL, options, &reader);
    }
+
+   if (prog->driver_cache_blob) {
+      ralloc_free(prog->driver_cache_blob);
+      prog->driver_cache_blob = NULL;
+      prog->driver_cache_blob_size = 0;
+   }
 }
-- 
2.14.1



More information about the mesa-dev mailing list