From 3816ced49bca2ab30971a85a01cd2adee465de37 Mon Sep 17 00:00:00 2001 From: Pieter De Baets Date: Mon, 11 Jul 2016 13:16:10 -0700 Subject: [PATCH] nil out pendingCalls when we're done with them Reviewed By: mmmulani Differential Revision: D3543825 fbshipit-source-id: cf2fcdb4e1536c00675fafa85d0f880313a80655 --- React/Base/RCTBatchedBridge.m | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/React/Base/RCTBatchedBridge.m b/React/Base/RCTBatchedBridge.m index 2e589b6e3e..527c882ecb 100644 --- a/React/Base/RCTBatchedBridge.m +++ b/React/Base/RCTBatchedBridge.m @@ -496,10 +496,14 @@ RCT_EXTERN NSArray *RCTGetModuleClasses(void); RCTAssertJSThread(); [_performanceLogger markStopForTag:RCTPLBridgeStartup]; + RCT_PROFILE_BEGIN_EVENT(0, @"Processing pendingCalls", @{ @"count": @(_pendingCalls.count) }); _loading = NO; - for (dispatch_block_t call in self->_pendingCalls) { + NSArray *pendingCalls = _pendingCalls; + _pendingCalls = nil; + for (dispatch_block_t call in pendingCalls) { call(); } + RCT_PROFILE_END_EVENT(0, @"", nil); } - (void)stopLoadingWithError:(NSError *)error