aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/newt/classes/jogamp/newt/WindowImpl.java5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/newt/classes/jogamp/newt/WindowImpl.java b/src/newt/classes/jogamp/newt/WindowImpl.java
index d033a8794..cb43fae32 100644
--- a/src/newt/classes/jogamp/newt/WindowImpl.java
+++ b/src/newt/classes/jogamp/newt/WindowImpl.java
@@ -879,7 +879,10 @@ public abstract class WindowImpl implements Window, NEWTEventConsumer
if( isNativeValid() ) {
screen.removeScreenModeListener(screenModeListenerImpl);
closeNativeImpl();
- config.getScreen().getDevice().close();
+ final AbstractGraphicsDevice cfgADevice = config.getScreen().getDevice();
+ if( cfgADevice != screen.getDisplay().getGraphicsDevice() ) { // don't pull display's device
+ cfgADevice.close(); // ensure a cfg's device is closed
+ }
setGraphicsConfiguration(null);
removeScreenReference();
}