aboutsummaryrefslogtreecommitdiffstats
path: root/src/jogl/classes/jogamp/opengl/GLAutoDrawableBase.java
diff options
context:
space:
mode:
authorSven Gothel <[email protected]>2014-07-31 07:32:08 +0200
committerSven Gothel <[email protected]>2014-07-31 07:32:08 +0200
commit60f397da5fd27e2140a0c1b3a102bba0e67c9f19 (patch)
tree8fedcb92e76f7382af44ba2ab908a1aec4e47539 /src/jogl/classes/jogamp/opengl/GLAutoDrawableBase.java
parentba1ffe66697c3175b423cb7ab9b686d73959708d (diff)
Fix NPE regression of commit ba1ffe66697c3175b423cb7ab9b686d73959708d
Diffstat (limited to 'src/jogl/classes/jogamp/opengl/GLAutoDrawableBase.java')
-rw-r--r--src/jogl/classes/jogamp/opengl/GLAutoDrawableBase.java17
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 ..