Skip to content

Commit 3fff164

Browse files
RCTDisplayLink.m > Use autoreleasepool from CFRunLoopPerformBlock
Summary: Changelog: [iOS][Fixed] This is a quick speculative fix since we know `CFRunLoopPerformBlock` does not push/pop an autorelease pool. Reviewed By: appden Differential Revision: D32657298 fbshipit-source-id: 4641ad89baf7889ba4bf80e6e64e26de02818cb8
1 parent b8f0e97 commit 3fff164

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

React/Base/RCTDisplayLink.m

+6-2
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,9 @@ - (void)registerModuleForFrameUpdates:(id<RCTBridgeModule>)module withModuleData
6262
[weakSelf updateJSDisplayLinkState];
6363
} else {
6464
CFRunLoopPerformBlock(cfRunLoop, kCFRunLoopDefaultMode, ^{
65-
[weakSelf updateJSDisplayLinkState];
65+
@autoreleasepool {
66+
[weakSelf updateJSDisplayLinkState];
67+
}
6668
});
6769
CFRunLoopWakeUp(cfRunLoop);
6870
}
@@ -73,7 +75,9 @@ - (void)registerModuleForFrameUpdates:(id<RCTBridgeModule>)module withModuleData
7375
// start receiving updates anyway.
7476
if (![observer isPaused] && _runLoop) {
7577
CFRunLoopPerformBlock([_runLoop getCFRunLoop], kCFRunLoopDefaultMode, ^{
76-
[self updateJSDisplayLinkState];
78+
@autoreleasepool {
79+
[self updateJSDisplayLinkState];
80+
}
7781
});
7882
}
7983
}

0 commit comments

Comments
 (0)