diff --git a/ReactAndroid/src/main/java/com/facebook/react/bridge/CatalystInstanceImpl.java b/ReactAndroid/src/main/java/com/facebook/react/bridge/CatalystInstanceImpl.java index cd42defc22c13b..7df882675659c7 100644 --- a/ReactAndroid/src/main/java/com/facebook/react/bridge/CatalystInstanceImpl.java +++ b/ReactAndroid/src/main/java/com/facebook/react/bridge/CatalystInstanceImpl.java @@ -23,7 +23,6 @@ import com.facebook.react.bridge.queue.ReactQueueConfigurationSpec; import com.facebook.react.common.ReactConstants; import com.facebook.react.common.annotations.VisibleForTesting; -import com.facebook.react.config.ReactFeatureFlags; import com.facebook.react.module.annotations.ReactModule; import com.facebook.react.turbomodule.core.CallInvokerHolderImpl; import com.facebook.react.turbomodule.core.interfaces.TurboModule; @@ -101,6 +100,7 @@ public String toString() { private JavaScriptContextHolder mJavaScriptContextHolder; private @Nullable TurboModuleRegistry mTurboModuleRegistry = null; + private @Nullable JSIModule mTurboModuleManagerJSIModule = null; // C++ parts private final HybridData mHybridData; @@ -353,11 +353,6 @@ public void run() { } } - final JSIModule turboModuleManager = - ReactFeatureFlags.useTurboModules - ? mJSIModuleRegistry.getModule(JSIModuleType.TurboModuleManager) - : null; - getReactQueueConfiguration() .getJSQueueThread() .runOnQueue( @@ -365,8 +360,8 @@ public void run() { @Override public void run() { // We need to destroy the TurboModuleManager on the JS Thread - if (turboModuleManager != null) { - turboModuleManager.onCatalystInstanceDestroy(); + if (mTurboModuleManagerJSIModule != null) { + mTurboModuleManagerJSIModule.onCatalystInstanceDestroy(); } getReactQueueConfiguration() @@ -563,8 +558,9 @@ public void run() { } } - public void setTurboModuleManager(JSIModule getter) { - mTurboModuleRegistry = (TurboModuleRegistry) getter; + public void setTurboModuleManager(JSIModule module) { + mTurboModuleRegistry = (TurboModuleRegistry) module; + mTurboModuleManagerJSIModule = module; } private void decrementPendingJSCalls() {