From 10b4957dc36005453d2a4e7a3b4de4df20d0c901 Mon Sep 17 00:00:00 2001 From: Sven Gothel Date: Wed, 20 Feb 2013 21:52:42 +0100 Subject: Fix NPE of Bug 679: The ctx was released w/o fully initialized (no proper ARB ctx of expected version ?) --- src/jogl/classes/jogamp/opengl/macosx/cgl/MacOSXCGLContext.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'src/jogl/classes/jogamp/opengl/macosx') diff --git a/src/jogl/classes/jogamp/opengl/macosx/cgl/MacOSXCGLContext.java b/src/jogl/classes/jogamp/opengl/macosx/cgl/MacOSXCGLContext.java index 9e0174595..dbb1d4931 100644 --- a/src/jogl/classes/jogamp/opengl/macosx/cgl/MacOSXCGLContext.java +++ b/src/jogl/classes/jogamp/opengl/macosx/cgl/MacOSXCGLContext.java @@ -793,7 +793,9 @@ public abstract class MacOSXCGLContext extends GLContextImpl @Override public boolean release(long ctx) { try { - gl.glFlush(); // w/o glFlush()/glFinish() OSX < 10.7 (NVidia driver) may freeze + if( null != MacOSXCGLContext.this.getGLProcAddressTable() ) { // gl successfully initialized ? + gl.glFlush(); // w/o glFlush()/glFinish() OSX < 10.7 (NVidia driver) may freeze + } } catch (GLException gle) { if(DEBUG) { System.err.println("MacOSXCGLContext.NSOpenGLImpl.release: INFO: glFlush() catched exception:"); -- cgit v1.2.3