diff --git a/engine/src/lwjgl-ogl/com/jme3/system/lwjgl/LwjglAbstractDisplay.java b/engine/src/lwjgl-ogl/com/jme3/system/lwjgl/LwjglAbstractDisplay.java index 5ec0a68be..b1171cd32 100644 --- a/engine/src/lwjgl-ogl/com/jme3/system/lwjgl/LwjglAbstractDisplay.java +++ b/engine/src/lwjgl-ogl/com/jme3/system/lwjgl/LwjglAbstractDisplay.java @@ -97,6 +97,11 @@ public abstract class LwjglAbstractDisplay extends LwjglContext implements Runna Thread.currentThread().setUncaughtExceptionHandler(new Thread.UncaughtExceptionHandler() { public void uncaughtException(Thread thread, Throwable thrown) { listener.handleError("Uncaught exception thrown in "+thread.toString(), thrown); + if (needClose.get()){ + // listener.handleError() has requested the + // context to close. Satisfy request. + deinitInThread(); + } } }); }