Permalink
Browse files

Limit calls to SoLoader

Reviewed By: kathryngray

Differential Revision: D5536048

fbshipit-source-id: 525d5a37f41671abd4b56e5a6f4b88e9af9927b8
  • Loading branch information...
javache authored and facebook-github-bot committed Aug 7, 2017
1 parent 16e96a5 commit 5d79b26011bb9b5f8020b0b62f3b79d93a57bee3
Showing with 7 additions and 2 deletions.
  1. +7 −2 ReactAndroid/src/main/java/com/facebook/react/bridge/ReactBridge.java
@@ -12,8 +12,13 @@
import com.facebook.soloader.SoLoader;
public class ReactBridge {
private static boolean sDidInit = false;
public static void staticInit() {
// Ideally we'd put this in static and only run it once, but that causes this method to get stripped
SoLoader.loadLibrary("reactnativejni");
// No locking required here, worst case we'll call into SoLoader twice
// which will do its own locking internally
if (!sDidInit) {
SoLoader.loadLibrary("reactnativejni");
sDidInit = true;
}
}
}

0 comments on commit 5d79b26

Please sign in to comment.