From 331e4a96e972b03dbf7dfbd9290c4ebd748dd3bf Mon Sep 17 00:00:00 2001 From: Tadeu Zagallo Date: Fri, 7 Aug 2015 16:11:12 -0100 Subject: [PATCH] [ReactNative] Preload ModuleData queue Summary: The module's methodQueue wasn't being created when accessing the modules directly on the bridge, without going through JS. Preload the queue for now to fix internal breakages, but I'll figure out a better way to keep it lazy afterwards. --- React/Base/RCTBatchedBridge.m | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/React/Base/RCTBatchedBridge.m b/React/Base/RCTBatchedBridge.m index 0cf76f249..9ca1e2044 100644 --- a/React/Base/RCTBatchedBridge.m +++ b/React/Base/RCTBatchedBridge.m @@ -305,6 +305,10 @@ id RCTGetLatestExecutor(void) for (RCTModuleData *moduleData in _moduleDataByID) { config[moduleData.name] = moduleData.config; + + // HACK(tadeu): Ensure the queue has been loaded, make it lazy later inside RCTModuleMap + (void)[moduleData queue]; + if ([moduleData.instance conformsToProtocol:@protocol(RCTFrameUpdateObserver)]) { [_frameUpdateObservers addObject:moduleData]; }