mirror of
https://github.com/zhigang1992/react-native.git
synced 2026-04-27 19:25:11 +08:00
Fixed race condition in RCTModuleData.methodQueue
Summary: public The implementation of the `methodQueue` lazy initializer in `RCTModuleData` could result in the queue being set twice, because calling `methodQueue` for a module that hasn't been instantiated would call `RCTModuleData.instance` to create the module, which itself calls `methodQueue`. It's not clear if this was causing a bug, but it may be related to an occasional bug where the `RCTViewManager.methodQueue` returns nil. Reviewed By: majak Differential Revision: D2783320 fb-gh-sync-id: 9194da0fd7392f63825da1f5c450363dd300b635
This commit is contained in:
committed by
facebook-github-bot-9
parent
46609cf7f0
commit
64edddadcc
@@ -94,7 +94,7 @@ RCT_EXTERN void RCTRegisterModule(Class); \
|
||||
* }
|
||||
*
|
||||
* If you don't want to specify the queue yourself, but you need to use it
|
||||
* inside your class (e.g. if you have internal methods that need to disaptch
|
||||
* inside your class (e.g. if you have internal methods that need to dispatch
|
||||
* onto that queue), you can just add `@synthesize methodQueue = _methodQueue;`
|
||||
* and the bridge will populate the methodQueue property for you automatically
|
||||
* when it initializes the module.
|
||||
|
||||
Reference in New Issue
Block a user