Only load OS X native code once.
MODIFY
runtime/src/jycessing/jni/OSX.java
runtime/src/jycessing/jni/OSX.java
@@ -4,16 +4,24 @@ import processing.core.PApplet;
import processing.core.PConstants;
public class OSX {
- public static void bringToFront() {
+ private static volatile boolean didLoad = false;
+
+ static {
if (PApplet.platform == PConstants.MACOSX) {
try {
System.loadLibrary("jniosx");
- activateIgnoringOtherApps();
+ didLoad = true;
} catch (final UnsatisfiedLinkError err) {
System.err.println("Hmm. Can't load native code to bring window to front.");
}
}
}
+ public static void bringToFront() {
+ if (didLoad) {
+ activateIgnoringOtherApps();
+ }
+ }
+
private static native void activateIgnoringOtherApps();
}

Only load OS X native code once.