diff --git a/briar-desktop/src/org/briarproject/plugins/file/UnixRemovableDriveMonitor.java b/briar-desktop/src/org/briarproject/plugins/file/UnixRemovableDriveMonitor.java index 8c4edee5f5d75d48b228e9dc2a412e8a7b51b166..5a57b316d03d7e4e2608547638145c15f1f27ed7 100644 --- a/briar-desktop/src/org/briarproject/plugins/file/UnixRemovableDriveMonitor.java +++ b/briar-desktop/src/org/briarproject/plugins/file/UnixRemovableDriveMonitor.java @@ -19,7 +19,8 @@ JNotifyListener { protected abstract String[] getPathsToWatch(); - final private static Throwable loadError = tryLoad(); + private static boolean triedLoad = false; + private static Throwable loadError = null; private static Throwable tryLoad() { try { @@ -32,7 +33,11 @@ JNotifyListener { } } - public static void checkEnabled() throws IOException { + public static synchronized void checkEnabled() throws IOException { + if (!triedLoad) { + loadError = tryLoad(); + triedLoad = true; + } if (loadError != null) { throw new IOException("JNotify not loaded", loadError); }