1 $NetBSD: patch-src_mesa_main_extensions.c,v 1.3 2022/03/13 15:50:05 tnn Exp $
3 atexit() is not a good idea in shared libraries.
5 FreeBSD reported atexit bug for 10.6:
6 https://bugs.freedesktop.org/show_bug.cgi?id=91869
8 --- src/mesa/main/extensions.c.orig 2021-07-14 20:04:58.316035000 +0000
9 +++ src/mesa/main/extensions.c
10 @@ -213,7 +213,11 @@ set_extension(struct gl_extensions *ext,
11 * This string is allocated early during the first context creation by
12 * _mesa_one_time_init_extension_overrides.
14 +#if defined(HAVE_NOATEXIT)
15 +static void __attribute__((__destructor__))
19 free_unknown_extensions_strings(void)
21 free(unrecognized_extensions.env);
22 @@ -304,7 +308,9 @@ _mesa_one_time_init_extension_overrides(
25 unrecognized_extensions.env = env;
26 +#if !defined(HAVE_NOATEXIT)
27 atexit(free_unknown_extensions_strings);