diff options
author | Sven Gothel <[email protected]> | 2009-06-18 10:15:56 +0000 |
---|---|---|
committer | Sven Gothel <[email protected]> | 2009-06-18 10:15:56 +0000 |
commit | a589761892ea2eb42a672951fcfe6e72786ac79b (patch) | |
tree | a7ea5131f2f061bbee924eaa5bd9d21d40703235 | |
parent | f8425e90bcfb7539915bed50b960efb3ab99e4a0 (diff) |
Fix NEWT static singleton init
git-svn-id: file:///usr/local/projects/SUN/JOGL/git-svn/svn-server-sync/jogl/trunk@1991 232f8b59-042b-4e1e-8c03-345bb8c30851
4 files changed, 16 insertions, 36 deletions
diff --git a/src/newt/classes/com/sun/javafx/newt/macosx/MacDisplay.java b/src/newt/classes/com/sun/javafx/newt/macosx/MacDisplay.java index 63b7fe78c..cd22b2b36 100755 --- a/src/newt/classes/com/sun/javafx/newt/macosx/MacDisplay.java +++ b/src/newt/classes/com/sun/javafx/newt/macosx/MacDisplay.java @@ -41,15 +41,6 @@ import com.sun.javafx.newt.util.MainThread; public class MacDisplay extends Display { static { - initSingleton(); - } - - private static volatile boolean isInit = false; - - public static synchronized void initSingleton() { - if(isInit) return; - isInit=true; - NativeLibLoader.loadNEWT(); if(!initNSApplication()) { @@ -60,6 +51,10 @@ public class MacDisplay extends Display { } if(DEBUG) System.out.println("MacDisplay.init App and IDs OK "+Thread.currentThread().getName()); } + + public static void initSingleton() { + // just exist to ensure static init has been run + } public MacDisplay() { } diff --git a/src/newt/classes/com/sun/javafx/newt/opengl/kd/KDDisplay.java b/src/newt/classes/com/sun/javafx/newt/opengl/kd/KDDisplay.java index 64d640d11..5aeae75ea 100755 --- a/src/newt/classes/com/sun/javafx/newt/opengl/kd/KDDisplay.java +++ b/src/newt/classes/com/sun/javafx/newt/opengl/kd/KDDisplay.java @@ -42,15 +42,6 @@ import javax.media.nativewindow.egl.*; public class KDDisplay extends Display { static { - initSingleton(); - } - - private static volatile boolean isInit = false; - - public static synchronized void initSingleton() { - if(isInit) return; - isInit=true; - NativeLibLoader.loadNEWT(); if (!KDWindow.initIDs()) { @@ -58,6 +49,10 @@ public class KDDisplay extends Display { } } + public static void initSingleton() { + // just exist to ensure static init has been run + } + public KDDisplay() { } diff --git a/src/newt/classes/com/sun/javafx/newt/windows/WindowsDisplay.java b/src/newt/classes/com/sun/javafx/newt/windows/WindowsDisplay.java index 975281c95..80485ed67 100755 --- a/src/newt/classes/com/sun/javafx/newt/windows/WindowsDisplay.java +++ b/src/newt/classes/com/sun/javafx/newt/windows/WindowsDisplay.java @@ -45,15 +45,6 @@ public class WindowsDisplay extends Display { private static long hInstance; static { - initSingleton(); - } - - private static volatile boolean isInit = false; - - public static synchronized void initSingleton() { - if(isInit) return; - isInit=true; - NativeLibLoader.loadNEWT(); if (!WindowsWindow.initIDs()) { @@ -61,6 +52,10 @@ public class WindowsDisplay extends Display { } } + public static void initSingleton() { + // just exist to ensure static init has been run + } + public WindowsDisplay() { } diff --git a/src/newt/classes/com/sun/javafx/newt/x11/X11Display.java b/src/newt/classes/com/sun/javafx/newt/x11/X11Display.java index 050b9b24d..5a2e0ad5d 100755 --- a/src/newt/classes/com/sun/javafx/newt/x11/X11Display.java +++ b/src/newt/classes/com/sun/javafx/newt/x11/X11Display.java @@ -41,15 +41,6 @@ import com.sun.nativewindow.impl.x11.X11Util; public class X11Display extends Display { static { - initSingleton(); - } - - private static volatile boolean isInit = false; - - public static synchronized void initSingleton() { - if(isInit) return; - isInit=true; - NativeLibLoader.loadNEWT(); if (!initIDs()) { @@ -61,6 +52,10 @@ public class X11Display extends Display { } } + public static void initSingleton() { + // just exist to ensure static init has been run + } + public X11Display() { } |