From: <eli...@us...> - 2008-04-13 18:11:40
|
Revision: 3017 http://java-game-lib.svn.sourceforge.net/java-game-lib/?rev=3017&view=rev Author: elias_naur Date: 2008-04-13 11:11:38 -0700 (Sun, 13 Apr 2008) Log Message: ----------- Linux: Some DRI drivers don't like to have the context destroyed before the window, even though the context is not current anymore. The destroy ordering in Display.destroy is now flipped as a workaround Modified Paths: -------------- trunk/LWJGL/src/java/org/lwjgl/opengl/Display.java Modified: trunk/LWJGL/src/java/org/lwjgl/opengl/Display.java =================================================================== --- trunk/LWJGL/src/java/org/lwjgl/opengl/Display.java 2008-04-13 17:04:05 UTC (rev 3016) +++ trunk/LWJGL/src/java/org/lwjgl/opengl/Display.java 2008-04-13 18:11:38 UTC (rev 3017) @@ -310,13 +310,7 @@ } } - private static void destroyWindow() { - if (!window_created) { - return; - } - if (parent != null) { - parent.removeComponentListener(component_listener); - } + private static void releaseDrawable() { try { if (context != null && context.isCurrent()) { Context.releaseCurrentContext(); @@ -325,7 +319,17 @@ } catch (LWJGLException e) { LWJGLUtil.log("Exception occurred while trying to release context: " + e); } + } + private static void destroyWindow() { + if (!window_created) { + return; + } + if (parent != null) { + parent.removeComponentListener(component_listener); + } + releaseDrawable(); + // Automatically destroy keyboard & mouse if (Mouse.isCreated()) { Mouse.destroy(); @@ -932,8 +936,9 @@ return; } + releaseDrawable(); + destroyContext(); destroyWindow(); - destroyContext(); destroyPeerInfo(); x = y = -1; cached_icons = null; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |