Janic Duplessis
c47759a9ae
Fix potential retain cycles in Animated iOS
Summary:
Fixes potential retain cycles detected by an internal fb tool.
```
First:
__NSDictionaryM
-> RCTPropsAnimatedNode
-> _parentNodes -> __NSDictionaryM
-> RCTStyleAnimatedNode
-> _childNodes -> __NSDictionaryM
Second:
RCTScrollView
-> _eventDispatcher -> RCTEventDispatcher
-> _observers -> __NSArrayM
-> RCTNativeAnimatedModule
-> _nodesManager -> RCTNativeAnimatedNodesManager
-> _uiManager -> RCTUIManager
-> _viewRegistry -> __NSDictionaryM
-> RCTScrollView
```
First fix:
Use weak map for parent and child nodes, strong refs are managed by RCTNativeAnimatedNodesManager
Second fix:
Make RCTEventDispatcher observers a weak array and make sure we don't keep strong refs to UIManager in RCTNativeAnimatedNodesManager and RCTPropsAnimatedNode.
Tested that native animations still work in UIExplorer
[IOS] [BUGFIX] [NativeAnimated] - Fix potential retain cycles in Animated iOS
Closes https://github.com/facebook/react-native/pull/16506
Differential Revision: D6126400
Pulled By: shergin
fbshipit-source-id: 1ac5083f8ab79a806305edc23ae4796ed428f78b
2017-10-23 13:20:59 -07:00
..
2017-10-10 03:32:08 -07:00
2017-09-11 16:08:03 -07:00
2017-10-13 17:50:17 -07:00
2017-08-18 13:14:59 -07:00
2017-09-25 10:30:53 -07:00
2017-10-10 16:32:28 -07:00
2017-09-06 03:33:43 -07:00
2017-02-08 14:50:43 -08:00
2017-09-14 12:02:27 -07:00
2017-10-20 03:50:25 -07:00
2017-10-19 13:53:27 -07:00
2017-10-13 08:04:17 -07:00
2017-09-28 22:16:08 -07:00
2017-08-09 07:48:09 -07:00
2017-09-06 03:33:43 -07:00
2017-10-20 03:50:25 -07:00
2017-09-06 03:33:43 -07:00
2017-10-10 16:32:28 -07:00
2016-11-02 12:29:15 -07:00
2017-09-06 03:33:43 -07:00
2017-09-08 14:46:14 -07:00
2017-07-31 05:20:03 -07:00
2017-10-16 04:35:05 -07:00
2017-09-21 15:01:52 -07:00
2017-10-23 13:20:59 -07:00
2017-10-13 18:02:06 -07:00
2017-08-14 07:19:00 -07:00
2017-08-16 15:01:51 -07:00
2017-08-21 16:29:39 -07:00
2017-08-14 12:03:18 -07:00
2017-09-21 18:30:38 -07:00
2017-09-28 22:16:08 -07:00
2017-10-18 19:33:31 -07:00
2017-10-04 10:16:15 -07:00
2017-07-31 05:20:03 -07:00
2017-08-09 09:39:40 -07:00
2017-10-23 11:32:44 -07:00
2017-02-21 15:18:40 -08:00
2017-10-20 03:50:25 -07:00
2017-10-20 03:50:25 -07:00
2017-10-20 18:02:14 -07:00
2017-09-06 03:33:43 -07:00
2017-10-09 17:46:44 -07:00
2017-10-04 19:17:07 -07:00
2017-10-09 17:22:35 -07:00
2017-08-17 16:20:04 -07:00
2017-09-06 03:33:43 -07:00
2017-09-06 03:33:43 -07:00