1 $NetBSD: patch-src_gallium_frontends_osmesa_osmesa.c,v 1.1 2022/03/13 15:52:50 tnn Exp $
3 atexit() is not a good idea in shared libraries.
5 --- src/gallium/frontends/osmesa/osmesa.c.orig 2021-07-14 20:04:55.420007000 +0000
6 +++ src/gallium/frontends/osmesa/osmesa.c
7 @@ -134,7 +134,11 @@ osmesa_st_get_param(struct st_manager *s
8 static struct st_manager *stmgr = NULL;
9 static struct st_api *stapi = NULL;
11 +#if defined(HAVE_NOATEXIT)
12 +static void __attribute__((__destructor__))
16 destroy_st_manager(void)
19 @@ -151,8 +155,10 @@ destroy_st_manager(void)
21 create_st_manager(void)
23 +#if !defined(HAVE_NOATEXIT)
24 if (atexit(destroy_st_manager) != 0)
28 stmgr = CALLOC_STRUCT(st_manager);