avoid crash when closing an app window (fixes #4690)

This commit is contained in:
Ben Fry
2016-10-04 13:53:48 -04:00
parent 6f32fd47e2
commit cedf101ccc
2 changed files with 11 additions and 0 deletions

View File

@@ -58,6 +58,7 @@ import com.jogamp.opengl.GLEventListener;
import com.jogamp.opengl.GLException;
import com.jogamp.opengl.GLProfile;
import com.jogamp.nativewindow.MutableGraphicsConfiguration;
import com.jogamp.nativewindow.WindowClosingProtocol;
import com.jogamp.newt.Display;
import com.jogamp.newt.Display.PointerIcon;
import com.jogamp.newt.MonitorDevice;
@@ -68,6 +69,7 @@ import com.jogamp.newt.event.InputEvent;
import com.jogamp.newt.opengl.GLWindow;
import com.jogamp.opengl.util.FPSAnimator;
import processing.core.PApplet;
import processing.core.PConstants;
import processing.core.PGraphics;
@@ -314,6 +316,12 @@ public class PSurfaceJOGL implements PSurface {
protected void initWindow() {
window = GLWindow.create(screen, pgl.getCaps());
// Make sure that we pass the window close through to exit(), otherwise
// we're likely to have OpenGL try to shut down halfway through rendering
// a frame. Particularly problematic for complex/slow apps.
// https://github.com/processing/processing/issues/4690
window.setDefaultCloseOperation(WindowClosingProtocol.WindowClosingMode.DO_NOTHING_ON_CLOSE);
// if (displayDevice == null) {
//
//
@@ -955,6 +963,7 @@ public class PSurfaceJOGL implements PSurface {
@Override
public void windowDestroyed(com.jogamp.newt.event.WindowEvent arg0) {
sketch.exit();
}
@Override

View File

@@ -2,6 +2,8 @@
X fix quoting problem in IntDict.toJSON()
X add getRenderer() to SurfaceInfo
X https://github.com/processing/processing/issues/4441
X Exceptions thrown in OpenGL apps when hitting window close box
X https://github.com/processing/processing/issues/4690
X add getRowMap() function
_ do we want rows() to not be transient?