Instead of using ralloc_autofree_context() to install an atexit()
handler to ralloc_free(glsl_type::mem_ctx), we can simply free them
from _mesa_glsl_release_types().
This is effectively the same, because _mesa_glsl_release_types() is
called from _mesa_destroy_shader_compiler(), which is called from Mesa's
one_time_fini() function, which Mesa installs as an atexit() handler.
The one advantage here is that it ensures the built-in functions are
destroyed before the types.
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
glsl_type::init_ralloc_type_ctx(void)
{
if (glsl_type::mem_ctx == NULL) {
- glsl_type::mem_ctx = ralloc_autofree_context();
+ glsl_type::mem_ctx = ralloc_context(NULL);
assert(glsl_type::mem_ctx != NULL);
}
}
_mesa_hash_table_destroy(glsl_type::interface_types, NULL);
glsl_type::interface_types = NULL;
}
+
+ ralloc_free(glsl_type::mem_ctx);
+ glsl_type::mem_ctx = NULL;
}