diff options
author | Sven Gothel <[email protected]> | 2014-07-31 07:32:08 +0200 |
---|---|---|
committer | Sven Gothel <[email protected]> | 2014-07-31 07:32:08 +0200 |
commit | 60f397da5fd27e2140a0c1b3a102bba0e67c9f19 (patch) | |
tree | 8fedcb92e76f7382af44ba2ab908a1aec4e47539 /src | |
parent | ba1ffe66697c3175b423cb7ab9b686d73959708d (diff) |
Fix NPE regression of commit ba1ffe66697c3175b423cb7ab9b686d73959708d
Diffstat (limited to 'src')
-rw-r--r-- | src/jogl/classes/jogamp/opengl/GLAutoDrawableBase.java | 17 |
1 files changed, 8 insertions, 9 deletions
diff --git a/src/jogl/classes/jogamp/opengl/GLAutoDrawableBase.java b/src/jogl/classes/jogamp/opengl/GLAutoDrawableBase.java index 016d07ed6..e1cd59a04 100644 --- a/src/jogl/classes/jogamp/opengl/GLAutoDrawableBase.java +++ b/src/jogl/classes/jogamp/opengl/GLAutoDrawableBase.java @@ -369,24 +369,23 @@ public abstract class GLAutoDrawableBase implements GLAutoDrawable, GLStateKeepe context = null; } - final AbstractGraphicsDevice device = drawable.getNativeSurface().getGraphicsConfiguration().getScreen().getDevice(); Throwable exceptionOnUnrealize = null; + Throwable exceptionOnDeviceClose = null; if( null != drawable ) { + final AbstractGraphicsDevice device = drawable.getNativeSurface().getGraphicsConfiguration().getScreen().getDevice(); try { drawable.setRealized(false); } catch( final Throwable re ) { exceptionOnUnrealize = re; } drawable = null; - } - - Throwable exceptionOnDeviceClose = null; - try { - if( ownsDevice ) { - device.close(); + try { + if( ownsDevice ) { + device.close(); + } + } catch (final Throwable re) { + exceptionOnDeviceClose = re; } - } catch (final Throwable re) { - exceptionOnDeviceClose = re; } // throw exception in order of occurrence .. |