summaryrefslogtreecommitdiffstats
path: root/src/newt/classes/com/jogamp
diff options
context:
space:
mode:
authorSven Gothel <[email protected]>2012-11-26 18:15:59 +0100
committerSven Gothel <[email protected]>2012-11-26 18:15:59 +0100
commit8cf694c1424277e6358039a964ecd75c54cf9af9 (patch)
tree72c37d6e8efe5d64951fd5fb8ef258a679caa3ca /src/newt/classes/com/jogamp
parent541bcc1eecc50656392e1fec1a27b08ab78eceff (diff)
SWTAccessor: OS_gtk_widget_unrealize optional (SWT 4.3) ; decorate PrivilegedAction for static initSingleton block (SWTAccessor, NewtFactory, NativeWindowFactory)
Diffstat (limited to 'src/newt/classes/com/jogamp')
-rw-r--r--src/newt/classes/com/jogamp/newt/NewtFactory.java13
1 files changed, 11 insertions, 2 deletions
diff --git a/src/newt/classes/com/jogamp/newt/NewtFactory.java b/src/newt/classes/com/jogamp/newt/NewtFactory.java
index 1bf47f4aa..b3e904310 100644
--- a/src/newt/classes/com/jogamp/newt/NewtFactory.java
+++ b/src/newt/classes/com/jogamp/newt/NewtFactory.java
@@ -34,6 +34,9 @@
package com.jogamp.newt;
+import java.security.AccessController;
+import java.security.PrivilegedAction;
+
import javax.media.nativewindow.AbstractGraphicsConfiguration;
import javax.media.nativewindow.AbstractGraphicsDevice;
import javax.media.nativewindow.AbstractGraphicsScreen;
@@ -41,6 +44,8 @@ import javax.media.nativewindow.CapabilitiesImmutable;
import javax.media.nativewindow.NativeWindow;
import javax.media.nativewindow.NativeWindowFactory;
+import com.jogamp.common.os.Platform;
+
import jogamp.newt.Debug;
import jogamp.newt.DisplayImpl;
import jogamp.newt.ScreenImpl;
@@ -54,8 +59,12 @@ public class NewtFactory {
// Work-around for initialization order problems on Mac OS X
// between native Newt and (apparently) Fmod
static {
- NativeWindowFactory.initSingleton(); // last resort ..
- WindowImpl.init(NativeWindowFactory.getNativeWindowType(true));
+ AccessController.doPrivileged(new PrivilegedAction<Object>() {
+ public Object run() {
+ NativeWindowFactory.initSingleton(); // last resort ..
+ WindowImpl.init(NativeWindowFactory.getNativeWindowType(true));
+ return null;
+ } } );
}
public static Class<?> getCustomClass(String packageName, String classBaseName) {