glsl: destroy function and subroutine hash tables
authorGrazvydas Ignotas <notasas@gmail.com>
Tue, 2 May 2017 18:06:50 +0000 (21:06 +0300)
committerTimothy Arceri <tarceri@itsqueeze.com>
Mon, 8 May 2017 03:18:23 +0000 (13:18 +1000)
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@gmail.com>
Reviewed-by: Timothy Arceri <tarceri@itsqueeze.com>
src/compiler/glsl_types.cpp

index 00a95d4a8ed376b649791de74285be4d90476610..3930029180d52d7c2b257a7d9586670c5ba67038 100644 (file)
@@ -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;
 }