diff --git a/React/Base/RCTBatchedBridge.m b/React/Base/RCTBatchedBridge.m index 569c7f7791d96d..9b77ad46604106 100644 --- a/React/Base/RCTBatchedBridge.m +++ b/React/Base/RCTBatchedBridge.m @@ -106,13 +106,6 @@ - (instancetype)initWithParentBridge:(RCTBridge *)bridge */ [self registerModules]; - /** - * If currently profiling, hook into the current instance - */ - if (RCTProfileIsProfiling()) { - RCTProfileHookModules(self); - } - /** * Start the application script */ @@ -371,13 +364,8 @@ - (void)invalidate } moduleData.queue = nil; } - dispatch_group_notify(group, dispatch_get_main_queue(), ^{ [_javaScriptExecutor executeBlockOnJavaScriptQueue:^{ - if (RCTProfileIsProfiling()) { - RCTProfileUnhookModules(self); - } - [_jsDisplayLink invalidate]; _jsDisplayLink = nil; diff --git a/React/Base/RCTProfile.h b/React/Base/RCTProfile.h index 66cf40bf4425a5..469a8155291b45 100644 --- a/React/Base/RCTProfile.h +++ b/React/Base/RCTProfile.h @@ -103,16 +103,6 @@ RCT_EXTERN void RCTProfileImmediateEvent(NSString *, NSTimeInterval , NSString * RCTProfileEndEvent([NSString stringWithFormat:@"[%@ %@]", NSStringFromClass([self class]), NSStringFromSelector(_cmd)], category, arguments); \ } -/** - * Hook into a bridge instance to log all bridge module's method calls - */ -RCT_EXTERN void RCTProfileHookModules(RCTBridge *); - -/** - * Unhook from a given bridge instance's modules - */ -RCT_EXTERN void RCTProfileUnhookModules(RCTBridge *); - #else #define RCTProfileBeginFlowEvent() @@ -135,7 +125,4 @@ RCT_EXTERN void RCTProfileUnhookModules(RCTBridge *); #define RCTProfileBlock(block, ...) block -#define RCTProfileHookModules(...) -#define RCTProfileUnhookModules(...) - #endif diff --git a/React/Base/RCTProfile.m b/React/Base/RCTProfile.m index 4eeaf3e9d95d25..62a17fe7b00d00 100644 --- a/React/Base/RCTProfile.m +++ b/React/Base/RCTProfile.m @@ -144,17 +144,14 @@ static IMP RCTProfileMsgForward(NSObject *self, SEL selector) return imp; } -void RCTProfileHookModules(RCTBridge *bridge) +static void RCTProfileHookModules(RCTBridge *); +static void RCTProfileHookModules(RCTBridge *bridge) { for (RCTModuleData *moduleData in [bridge valueForKey:@"_modules"]) { [moduleData dispatchBlock:^{ Class moduleClass = moduleData.cls; Class proxyClass = objc_allocateClassPair(moduleClass, RCTProfileProxyClassName(moduleClass), 0); - if (!proxyClass) { - return; - } - unsigned int methodCount; Method *methods = class_copyMethodList(moduleClass, &methodCount); for (NSUInteger i = 0; i < methodCount; i++) { @@ -188,6 +185,7 @@ void RCTProfileHookModules(RCTBridge *bridge) } } +void RCTProfileUnhookModules(RCTBridge *); void RCTProfileUnhookModules(RCTBridge *bridge) { for (RCTModuleData *moduleData in [bridge valueForKey:@"_modules"]) { diff --git a/React/Views/RCTNavigator.m b/React/Views/RCTNavigator.m index ff91b0b5474c9f..63e3d8023462f7 100644 --- a/React/Views/RCTNavigator.m +++ b/React/Views/RCTNavigator.m @@ -436,7 +436,7 @@ - (void)dispatchFakeScrollEvent */ - (UIView *)reactSuperview { - RCTAssert(!_bridge.isValid || self.superview != nil, @"put reactNavSuperviewLink back"); + RCTAssert(self.superview != nil, @"put reactNavSuperviewLink back"); return self.superview ? self.superview : self.reactNavSuperviewLink; }