mirror of
https://github.com/facebook/react-native.git
synced 2025-11-01 09:14:26 +00:00
Use whether react instance is accepting calls to determine whether instance is active
Summary: There was previously a race condition where hasActiveCatalystInstance would return true, but calling a JS module call on it would result in a crash. Now, hasActivtyCatalystInstance will only return true once the instance is actually accepting calls. I'll follow this up with a more risky diff that gets rid of hasActiveCatalystInstance and just queues JS calls until runJSBundle is called. Reviewed By: javache Differential Revision: D4117374 fbshipit-source-id: 60941f68b0906a8213571305c564bfe3d053f51b
This commit is contained in:
committed by
Facebook Github Bot
parent
bdbadd1142
commit
6a45f05872
@@ -143,7 +143,7 @@ public class ReactContext extends ContextWrapper {
|
||||
}
|
||||
|
||||
public boolean hasActiveCatalystInstance() {
|
||||
return mCatalystInstance != null && !mCatalystInstance.isDestroyed();
|
||||
return mCatalystInstance != null && mCatalystInstance.isAcceptingCalls();
|
||||
}
|
||||
|
||||
public LifecycleState getLifecycleState() {
|
||||
|
||||
Reference in New Issue
Block a user