From 63589487d91d13b2e844f1a57a8c3c646ae25ee2 Mon Sep 17 00:00:00 2001 From: Elias Naur Date: Thu, 12 Jan 2006 12:25:12 +0000 Subject: [PATCH] Linux: Added workaround to avoid crash on exit with nvidia drivers --- src/java/org/lwjgl/opengl/GLContext.java | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/java/org/lwjgl/opengl/GLContext.java b/src/java/org/lwjgl/opengl/GLContext.java index 3e5276f1..3946393c 100644 --- a/src/java/org/lwjgl/opengl/GLContext.java +++ b/src/java/org/lwjgl/opengl/GLContext.java @@ -320,7 +320,11 @@ public final class GLContext { /** The OpenGL library reference count is decremented, and if it reaches 0, the library is unloaded. */ public static synchronized void unloadOpenGLLibrary() { gl_ref_count--; - if ( gl_ref_count == 0 ) + /* + * Unload the native OpenGL library unless we're on linux, since + * some drivers (NVIDIA proprietary) crash on exit when unloading the library. + */ + if (gl_ref_count == 0 && LWJGLUtil.getPlatform() != LWJGLUtil.PLATFORM_LINUX) nUnloadOpenGLLibrary(); }