diff options
Diffstat (limited to 'src/nativewindow/classes/jogamp')
5 files changed, 17 insertions, 10 deletions
diff --git a/src/nativewindow/classes/jogamp/nativewindow/NWJNILibLoader.java b/src/nativewindow/classes/jogamp/nativewindow/NWJNILibLoader.java index 4cf8f448e..be41ad719 100644 --- a/src/nativewindow/classes/jogamp/nativewindow/NWJNILibLoader.java +++ b/src/nativewindow/classes/jogamp/nativewindow/NWJNILibLoader.java @@ -38,18 +38,17 @@ import com.jogamp.common.util.cache.TempJarCache; public class NWJNILibLoader extends JNILibLoaderBase { - public static void loadNativeWindow(final String ossuffix) { - AccessController.doPrivileged(new PrivilegedAction<Object>() { - public Object run() { + public static boolean loadNativeWindow(final String ossuffix) { + return AccessController.doPrivileged(new PrivilegedAction<Boolean>() { + public Boolean run() { Platform.initSingleton(); final String libName = "nativewindow_"+ossuffix ; if(TempJarCache.isInitialized() && null == TempJarCache.findLibrary(libName)) { addNativeJarLibs(NWJNILibLoader.class, "jogl-all", new String[] { "nativewindow" } ); } - loadLibrary(libName, false); - return null; + return new Boolean(loadLibrary(libName, false)); } - }); + }).booleanValue(); } } diff --git a/src/nativewindow/classes/jogamp/nativewindow/jawt/JAWTUtil.java b/src/nativewindow/classes/jogamp/nativewindow/jawt/JAWTUtil.java index a9326cc4a..2ecbc61e2 100644 --- a/src/nativewindow/classes/jogamp/nativewindow/jawt/JAWTUtil.java +++ b/src/nativewindow/classes/jogamp/nativewindow/jawt/JAWTUtil.java @@ -168,7 +168,9 @@ public class JAWTUtil { // Thread.dumpStack(); } JAWTJNILibLoader.initSingleton(); - JAWTJNILibLoader.loadNativeWindow("awt"); + if(!JAWTJNILibLoader.loadNativeWindow("awt")) { + throw new NativeWindowException("NativeWindow AWT native library load error."); + } headlessMode = GraphicsEnvironment.isHeadless(); boolean ok = false; diff --git a/src/nativewindow/classes/jogamp/nativewindow/macosx/OSXUtil.java b/src/nativewindow/classes/jogamp/nativewindow/macosx/OSXUtil.java index 5b1e4b0a7..3ca76a84a 100644 --- a/src/nativewindow/classes/jogamp/nativewindow/macosx/OSXUtil.java +++ b/src/nativewindow/classes/jogamp/nativewindow/macosx/OSXUtil.java @@ -39,7 +39,9 @@ public class OSXUtil { public static synchronized void initSingleton(boolean firstX11ActionOnProcess) { if(!isInit) { - NWJNILibLoader.loadNativeWindow("macosx"); + if(!NWJNILibLoader.loadNativeWindow("macosx")) { + throw new NativeWindowException("NativeWindow MacOSX native library load error."); + } if( !initIDs0() ) { throw new NativeWindowException("MacOSX: Could not initialized native stub"); diff --git a/src/nativewindow/classes/jogamp/nativewindow/windows/GDIUtil.java b/src/nativewindow/classes/jogamp/nativewindow/windows/GDIUtil.java index be531d9ee..d17a1898c 100644 --- a/src/nativewindow/classes/jogamp/nativewindow/windows/GDIUtil.java +++ b/src/nativewindow/classes/jogamp/nativewindow/windows/GDIUtil.java @@ -46,7 +46,9 @@ public class GDIUtil { synchronized(X11Util.class) { if(!isInit) { isInit = true; - NWJNILibLoader.loadNativeWindow("win32"); + if(!NWJNILibLoader.loadNativeWindow("win32")) { + throw new NativeWindowException("NativeWindow Windows native library load error."); + } if( !initIDs0() ) { throw new NativeWindowException("GDI: Could not initialized native stub"); diff --git a/src/nativewindow/classes/jogamp/nativewindow/x11/X11Util.java b/src/nativewindow/classes/jogamp/nativewindow/x11/X11Util.java index 560130dd1..7e5155771 100644 --- a/src/nativewindow/classes/jogamp/nativewindow/x11/X11Util.java +++ b/src/nativewindow/classes/jogamp/nativewindow/x11/X11Util.java @@ -101,7 +101,9 @@ public class X11Util { synchronized(X11Util.class) { if(!isInit) { isInit = true; - NWJNILibLoader.loadNativeWindow("x11"); + if(!NWJNILibLoader.loadNativeWindow("x11")) { + throw new NativeWindowException("NativeWindow X11 native library load error."); + } final boolean callXInitThreads = XINITTHREADS_ALWAYS_ENABLED || firstX11ActionOnProcess; final boolean isXInitThreadsOK = initialize0( XINITTHREADS_ALWAYS_ENABLED || firstX11ActionOnProcess ); |