Skip to content

Commit

Permalink
Initialize "rninstance" at ReactInstance class loading time (#38026)
Browse files Browse the repository at this point in the history
Summary:
Pull Request resolved: #38026

In this diff I'm moving the initialization of "rninstance" so as soon as the class is loaded

The goal is to ensure so is loaded earlier and prevent issues like T156403678

changelog: [internal] internal

Reviewed By: luluwu2032

Differential Revision: D46945464

fbshipit-source-id: f4d68574030ca3bda5d55fe3a9c1630a4879f3ab
  • Loading branch information
mdvacca authored and facebook-github-bot committed Jun 22, 2023
1 parent 0a9284a commit 95847fc
Showing 1 changed file with 4 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,10 @@ final class ReactInstance {

@DoNotStrip @Nullable private ComponentNameResolverManager mComponentNameResolverManager;

static {
loadLibraryIfNeeded();
}

private static volatile boolean sIsLibraryLoaded;

/* package */ ReactInstance(
Expand All @@ -100,7 +104,6 @@ final class ReactInstance {
boolean useDevSupport) {
mBridgelessReactContext = bridgelessReactContext;
mDelegate = delegate;
loadLibraryIfNeeded();

Systrace.beginSection(Systrace.TRACE_TAG_REACT_JAVA_BRIDGE, "ReactInstance.initialize");

Expand Down

0 comments on commit 95847fc

Please sign in to comment.