We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent a31bb2d commit e999da1Copy full SHA for e999da1
React/CxxBridge/RCTMessageThread.mm
@@ -36,7 +36,13 @@
36
37
// This is analogous to dispatch_async
38
void RCTMessageThread::runAsync(std::function<void()> func) {
39
- CFRunLoopPerformBlock(m_cfRunLoop, kCFRunLoopCommonModes, ^{ func(); });
+ // Cherry picked from https://github.com/facebook/react-native/pull/27395/files to fix autorelease pool memory growth
40
+ CFRunLoopPerformBlock(m_cfRunLoop, kCFRunLoopCommonModes, ^{
41
+ // Create an autorelease pool each run loop to prevent memory footprint from growing too large, which can lead to performance problems.
42
+ @autoreleasepool {
43
+ func();
44
+ }
45
+ });
46
CFRunLoopWakeUp(m_cfRunLoop);
47
}
48
0 commit comments