compiler: Free types in _mesa_glsl_release_types() rather than autofree.
authorKenneth Graunke <kenneth@whitecape.org>
Fri, 24 Feb 2017 01:58:43 +0000 (01:58 +0000)
committerKenneth Graunke <kenneth@whitecape.org>
Mon, 27 Feb 2017 23:46:12 +0000 (15:46 -0800)
commitaa8bb9fc157367a12aa83a44b627ddeed02e2711
tree54ee55e23c891d7f864ad4360521e415c11667ae
parent010fecb8536abd5e806206ceafca79bb71cff69f
compiler: Free types in _mesa_glsl_release_types() rather than autofree.

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>
src/compiler/glsl_types.cpp