[Mesa-dev] [PATCH] glsl: destroy function and subroutine hash tables

Grazvydas Ignotas notasas at gmail.com
Tue May 2 18:06:50 UTC 2017


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>
---
 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 0480bef..26cf755 100644
--- a/src/compiler/glsl_types.cpp
+++ b/src/compiler/glsl_types.cpp
@@ -415,10 +415,20 @@ _mesa_glsl_release_types(void)
    if (glsl_type::interface_types != NULL) {
       _mesa_hash_table_destroy(glsl_type::interface_types, NULL);
       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;
 }
 
 
-- 
2.7.4



More information about the mesa-dev mailing list