mirror of
https://github.com/status-im/react-native.git
synced 2025-01-27 01:40:08 +00:00
Weakly capture the bridge in callback methods
Summary: Callback blocks are frequently held onto by modules, e.g. for animation the `RCTFrameAnimation` holds onto its callback method. This causes a bunch of retain cycles since the module will be strongly held onto by the bridge. Reviewed By: Megra Differential Revision: D7492136 fbshipit-source-id: 708e61ffe7bf0dcffaebc056ab861b9023ffc1df
This commit is contained in:
parent
6be5d7827b
commit
52a3443e98
@ -213,7 +213,7 @@ RCT_EXTERN_C_END
|
||||
#endif
|
||||
|
||||
#define RCT_RETAINED_ARG_BLOCK(_logic) \
|
||||
[argumentBlocks addObject:^(__unused RCTBridge *bridge, NSUInteger index, id json) { \
|
||||
[argumentBlocks addObject:^(__unused __weak RCTBridge *bridge, NSUInteger index, id json) { \
|
||||
_logic \
|
||||
[invocation setArgument:&value atIndex:(index) + 2]; \
|
||||
if (value) { \
|
||||
|
Loading…
x
Reference in New Issue
Block a user