47e52e5e3e
Set INSTALLATION_PREFIX to allow this to co-exist with graphics/MesaLib. This package is here to allow x11/modular-xorg-server112 to find dri drivers, which it should pick up from /usr/pkg/MesaLib7/lib/dri.
40 lines
1,005 B
C
40 lines
1,005 B
C
$NetBSD: patch-src_mesa_main_context.c,v 1.1 2015/04/05 17:01:37 tnn Exp $
|
|
|
|
* Fix exit time segfault of qt5 application with modular xorg
|
|
|
|
--- src/mesa/main/context.c.orig 2011-10-15 00:43:58.000000000 +0000
|
|
+++ src/mesa/main/context.c
|
|
@@ -383,10 +383,10 @@ _glthread_DECLARE_STATIC_MUTEX(OneTimeLo
|
|
*
|
|
* \sa _math_init().
|
|
*/
|
|
+static GLbitfield api_init_mask = 0x0;
|
|
static void
|
|
one_time_init( struct gl_context *ctx )
|
|
{
|
|
- static GLbitfield api_init_mask = 0x0;
|
|
|
|
_glthread_LOCK_MUTEX(OneTimeLock);
|
|
|
|
@@ -441,14 +441,16 @@ one_time_init( struct gl_context *ctx )
|
|
|
|
_glthread_UNLOCK_MUTEX(OneTimeLock);
|
|
|
|
- /* Hopefully atexit() is widely available. If not, we may need some
|
|
- * #ifdef tests here.
|
|
- */
|
|
- atexit(_mesa_destroy_shader_compiler);
|
|
-
|
|
dummy_enum_func();
|
|
}
|
|
|
|
+static void __attribute__((__destructor__))
|
|
+one_time_fini(void)
|
|
+{
|
|
+ if (api_init_mask)
|
|
+ _mesa_destroy_shader_compiler();
|
|
+}
|
|
+
|
|
|
|
/**
|
|
* Initialize fields of gl_current_attrib (aka ctx->Current.*)
|