From ad0ba11b0a1d6cb4a113e467420f2f797f1d26cb Mon Sep 17 00:00:00 2001 From: Sven Gothel Date: Wed, 30 Nov 2011 13:13:27 +0100 Subject: More Robust GLProfile Initialization ; Add NativeWindowFactory Shutdown More Robust GLProfile Initialization - Catch GLException in GLDrawableFactory getWasSharedContextCreated(device) impl., which may fail (See comment on Firefox/Chorme EGL deployed library for Windows). - If getWasSharedContextCreated(devide) fails, set respective factory availability to false, ie. hasDesktopGLFactory, hasEGLFactory, .. Add NativeWindowFactory Shutdown - Currenly a dummy entry, may evolve. X11Util shutdown is issued by respective GLDrawableFactory --- .../javax/media/nativewindow/NativeWindowFactory.java | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'src/nativewindow/classes') diff --git a/src/nativewindow/classes/javax/media/nativewindow/NativeWindowFactory.java b/src/nativewindow/classes/javax/media/nativewindow/NativeWindowFactory.java index 9bc8ca9e4..39fe4fadc 100644 --- a/src/nativewindow/classes/javax/media/nativewindow/NativeWindowFactory.java +++ b/src/nativewindow/classes/javax/media/nativewindow/NativeWindowFactory.java @@ -265,6 +265,19 @@ public abstract class NativeWindowFactory { } } + public static synchronized void shutdown() { + if(initialized) { + initialized = false; + if(DEBUG) { + System.err.println(Thread.currentThread().getName()+" - NativeWindowFactory.shutdown() START"); + } + // X11Util.shutdown(..) already called via GLDrawableFactory.shutdown() .. + if(DEBUG) { + System.err.println(Thread.currentThread().getName()+" - NativeWindowFactory.shutdown() END"); + } + } + } + /** @return true if initialized with {@link #initSingleton(boolean) initSingleton(firstUIActionOnProcess==true)}, otherwise false. */ public static boolean isFirstUIActionOnProcess() { -- cgit v1.2.3