diff options
author | Yevhenii Kolesnikov <[email protected]> | 2019-07-18 17:38:48 +0300 |
---|---|---|
committer | Yevhenii Kolesnikov <[email protected]> | 2019-07-19 11:22:55 +0300 |
commit | 32b72cbca59a7d04a738087367bf886881a43f64 (patch) | |
tree | d46ef17c4aae22b09ee44ddc81f8d1902f50dd2c /src | |
parent | 248161123cbd05a6c419ae69883b2d257db003d3 (diff) |
main: Destroy static hash table
format_array_format_table has a static lifetime - it will be destroyed
by an atexit handler.
Signed-off-by: Yevhenii Kolesnikov <[email protected]>
Reviewed-by: Eric Engestrom <[email protected]>
Reviewed-by: Eric Anholt <[email protected]>
Diffstat (limited to 'src')
-rw-r--r-- | src/mesa/main/formats.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/src/mesa/main/formats.c b/src/mesa/main/formats.c index fb1f47bd11b..1abc83c66ab 100644 --- a/src/mesa/main/formats.c +++ b/src/mesa/main/formats.c @@ -426,6 +426,12 @@ _mesa_format_to_array_format(mesa_format format) static struct hash_table *format_array_format_table; static once_flag format_array_format_table_exists = ONCE_FLAG_INIT; +static void +format_array_format_table_destroy(void) +{ + _mesa_hash_table_destroy(format_array_format_table, NULL); +} + static bool array_formats_equal(const void *a, const void *b) { @@ -471,6 +477,8 @@ format_array_format_table_init(void) (void *)(intptr_t)array_format, (void *)(intptr_t)f); } + + atexit(format_array_format_table_destroy); } mesa_format |