diff options
author | Sven Gothel <[email protected]> | 2011-12-01 21:40:12 +0100 |
---|---|---|
committer | Sven Gothel <[email protected]> | 2011-12-01 21:40:12 +0100 |
commit | b6aa455d21fbcfc256ae8f8f4d66493c17e23f4c (patch) | |
tree | 373c8a31d6ce9ac98cd290e8c6872ec6145f0c7e /src/nativewindow | |
parent | 919aabb77250cb0e272dac228388592d08bf98f5 (diff) |
New GLProfile.ShutdownType: SHARED_ONLY / COMPLETE - Enhance/Fix Lifecycle Management
- Leave Platform, .. TempJarCache untouched.
- GLDrawableFactoryImpl*: Leave DynamicLibraryBundle(lib-binding) untouched,
for NativeLibrary, JNILibLoaderBase (JNI libs), .. consistency.
- SHARED_ONLY: shutdown shared GLDrawableFactoryImpl* resources and NativeWindowFactory
- COMPLETE: additionally shutdown GLContext*
Clear all cached GL/GLX proc-address and device/context mappings.
- Use new "GLProfile.shutdown(GLProfile.ShutdownType.SHARED_ONLY)" in Applets
- X11GLXDrawableFactory Shutdown: Uncomment close/destroy of shared resources.
- JAWTWindow.destroy(): Close the delegated device.
In case it's X11 this closes the exclusive opened X11 Display.
Diffstat (limited to 'src/nativewindow')
4 files changed, 11 insertions, 7 deletions
diff --git a/src/nativewindow/classes/javax/media/nativewindow/AbstractGraphicsDevice.java b/src/nativewindow/classes/javax/media/nativewindow/AbstractGraphicsDevice.java index 83b437612..fa25c214f 100644 --- a/src/nativewindow/classes/javax/media/nativewindow/AbstractGraphicsDevice.java +++ b/src/nativewindow/classes/javax/media/nativewindow/AbstractGraphicsDevice.java @@ -110,14 +110,15 @@ public interface AbstractGraphicsDevice extends Cloneable { public void unlock(); /** - * Optionally closing the device.<br> - * The default implementation is a NOP operation, returning false.<br> + * Optionally closing the device. + * <p> + * The default implementation is a <code>NOP</code>, just setting the handle to <code>null</code>. + * </p> * The specific implementing, ie {@link javax.media.nativewindow.x11.X11GraphicsDevice}, * shall have a enable/disable like {@link javax.media.nativewindow.x11.X11GraphicsDevice#setCloseDisplay(boolean, boolean)},<br> * which shall be invoked at creation time to determine ownership/role of freeing the resource.<br> * - * @return true if a specialized closing operation was successfully issued, otherwise false, - * ie no native closing operation was issued, which doesn't imply an error at all. + * @return true if the handle was not <code>null</code>, otherwise false. */ public boolean close(); } diff --git a/src/nativewindow/classes/javax/media/nativewindow/DefaultGraphicsDevice.java b/src/nativewindow/classes/javax/media/nativewindow/DefaultGraphicsDevice.java index 331167244..187959a67 100644 --- a/src/nativewindow/classes/javax/media/nativewindow/DefaultGraphicsDevice.java +++ b/src/nativewindow/classes/javax/media/nativewindow/DefaultGraphicsDevice.java @@ -140,6 +140,10 @@ public class DefaultGraphicsDevice implements Cloneable, AbstractGraphicsDevice } public boolean close() { + if(0 != handle) { + handle = 0; + return true; + } return false; } diff --git a/src/nativewindow/classes/javax/media/nativewindow/x11/X11GraphicsDevice.java b/src/nativewindow/classes/javax/media/nativewindow/x11/X11GraphicsDevice.java index ac4aacec7..73c8cfd52 100644 --- a/src/nativewindow/classes/javax/media/nativewindow/x11/X11GraphicsDevice.java +++ b/src/nativewindow/classes/javax/media/nativewindow/x11/X11GraphicsDevice.java @@ -96,10 +96,8 @@ public class X11GraphicsDevice extends DefaultGraphicsDevice implements Cloneabl System.err.println(Thread.currentThread().getName() + " - X11GraphicsDevice.close(): "+this); } X11Util.closeDisplay(handle); - handle = 0; - return true; } - return false; + return super.close(); } } diff --git a/src/nativewindow/classes/jogamp/nativewindow/jawt/JAWTWindow.java b/src/nativewindow/classes/jogamp/nativewindow/jawt/JAWTWindow.java index 712d5ddae..938760801 100644 --- a/src/nativewindow/classes/jogamp/nativewindow/jawt/JAWTWindow.java +++ b/src/nativewindow/classes/jogamp/nativewindow/jawt/JAWTWindow.java @@ -356,6 +356,7 @@ public abstract class JAWTWindow implements NativeWindow, OffscreenLayerSurface public synchronized void destroy() { invalidate(); + getGraphicsConfiguration().getScreen().getDevice().close(); component = null; // don't dispose the AWT component, since we are merely an immutable uplink } |