Mesa (master): glsl: destroy function and subroutine hash tables

Timothy Arceri tarceri at kemper.freedesktop.org
Mon May 8 03:18:42 UTC 2017


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

Author: Grazvydas Ignotas <notasas at gmail.com>
Date:   Tue May  2 21:06:50 2017 +0300

glsl: destroy function and subroutine hash tables

Just like other type hash tables are destroyed in
_mesa_glsl_release_types(), also destroy the ones for function and
subroutine types.

Signed-off-by: Grazvydas Ignotas <notasas at gmail.com>
Reviewed-by: Timothy Arceri <tarceri at itsqueeze.com>

---

 src/compiler/glsl_types.cpp | 10 ++++++++++
 1 file changed, 10 insertions(+)

diff --git a/src/compiler/glsl_types.cpp b/src/compiler/glsl_types.cpp
index 00a95d4a8e..3930029180 100644
--- a/src/compiler/glsl_types.cpp
+++ b/src/compiler/glsl_types.cpp
@@ -412,6 +412,16 @@ _mesa_glsl_release_types(void)
       glsl_type::interface_types = NULL;
    }
 
+   if (glsl_type::function_types != NULL) {
+      _mesa_hash_table_destroy(glsl_type::function_types, NULL);
+      glsl_type::function_types = NULL;
+   }
+
+   if (glsl_type::subroutine_types != NULL) {
+      _mesa_hash_table_destroy(glsl_type::subroutine_types, NULL);
+      glsl_type::subroutine_types = NULL;
+   }
+
    ralloc_free(glsl_type::mem_ctx);
    glsl_type::mem_ctx = NULL;
 }




More information about the mesa-commit mailing list