diff options
author | Sven Gothel <[email protected]> | 2013-06-25 07:04:17 +0200 |
---|---|---|
committer | Sven Gothel <[email protected]> | 2013-06-25 07:04:17 +0200 |
commit | cc64ad2b1f7904af4e7bd27e927e0bb331db782b (patch) | |
tree | 3ac2ea6921df21bf86e2219da2ab39b74c6df007 /src/newt/classes/jogamp | |
parent | a584e5dd4b40afec3cc04e1ce4abe3eb2f86e04c (diff) |
NEWT WindowImpl/GLWindow: @ JVM Shutdown, force stop animation thread w/o blocking.
Diffstat (limited to 'src/newt/classes/jogamp')
-rw-r--r-- | src/newt/classes/jogamp/newt/WindowImpl.java | 17 |
1 files changed, 14 insertions, 3 deletions
diff --git a/src/newt/classes/jogamp/newt/WindowImpl.java b/src/newt/classes/jogamp/newt/WindowImpl.java index 6787f0ab3..77ff21061 100644 --- a/src/newt/classes/jogamp/newt/WindowImpl.java +++ b/src/newt/classes/jogamp/newt/WindowImpl.java @@ -88,7 +88,7 @@ public abstract class WindowImpl implements Window, NEWTEventConsumer ScreenImpl.initSingleton(); } - /** Maybe utilized at a shutdown hook, impl. does not synchronize, however the Window destruction and EDT removal blocks. */ + /** Maybe utilized at a shutdown hook, impl. does not block. */ public static final void shutdownAll() { final int wCount = windowList.size(); if(DEBUG_IMPLEMENTATION) { @@ -99,7 +99,7 @@ public abstract class WindowImpl implements Window, NEWTEventConsumer if(DEBUG_IMPLEMENTATION) { System.err.println("Window.shutdownAll["+(i+1)+"/"+wCount+"]: "+toHexString(w.getWindowHandle())); } - w.markInvalid(); + w.shutdown(); } } @@ -242,7 +242,10 @@ public abstract class WindowImpl implements Window, NEWTEventConsumer } /** Fast invalidation of instance w/o any blocking function call. */ - private final void markInvalid() { + private final void shutdown() { + if(null!=lifecycleHook) { + lifecycleHook.shutdownRenderingAction(); + } setWindowHandle(0); visible = false; fullscreen = false; @@ -310,6 +313,14 @@ public abstract class WindowImpl implements Window, NEWTEventConsumer * @see #pauseRenderingAction() */ void resumeRenderingAction(); + + /** + * Shutdown rendering action (thread) abnormally. + * <p> + * Should be called only at shutdown, if necessary. + * </p> + */ + void shutdownRenderingAction(); } private boolean createNative() { |