react-native-macos/React
Mehdi Mulani 947e71a922 Add RCTWeakProxy to properly deallocate RCTUIImageViewAnimated
Summary:
@public
CADisplayLink strongly holds onto its target, so you have to use a weak proxy object to pass the target into the CADisplayLink.

Previously we passed a weak-self point (i.e. weakSelf) but this did not have the intended effect, since the pointer to self would still be passed to CADisplayLink, and thus it would hold onto the RCTUIImageViewAnimated strongly.

So is weakSelf doing anything other than using self?
It is but it's very minor and not useful. In the case that the object got de-allocated between assigning self to weakSelf and creating the CADisplayLink, then we would pass a nil target. This is actually impossible though because we are running an instance method, so self is implicitly retained! So semantically it is something different but in practice it is the same as passing self through.

Notes:
* This system was added originally in https://github.com/facebook/react-native/pull/24822
* https://github.com/facebook/react-native/pull/25636 then "enabled" this system by deprecating existing approach

Reviewed By: fkgozali

Differential Revision: D16939869

fbshipit-source-id: 7a0e947896f23aa30ad074d1dcb4d4db7543e00a
2019-08-22 10:16:52 -07:00
..
Base Add RCTWeakProxy to properly deallocate RCTUIImageViewAnimated 2019-08-22 10:16:52 -07:00
CoreModules Ensure ImageLoader is lazily loaded as necessary 2019-08-21 16:11:32 -07:00
CxxBridge Remove ; from method implementation definition 2019-08-21 15:49:16 -07:00
CxxModule Remove ; from method implementation definition 2019-08-21 15:49:16 -07:00
CxxUtils Update copyright headers to yearless format 2018-09-11 15:33:07 -07:00
DevSupport Don't call sharedApplication in App Extension (#26077) 2019-08-19 02:49:59 -07:00
Fabric Remove ; from method implementation definition 2019-08-21 15:49:16 -07:00
Inspector CocoaPods frameworks compatibility: Step 2 (#25619) 2019-07-24 23:27:09 -07:00
Modules Remove ; from method implementation definition 2019-08-21 15:49:16 -07:00
Profiler Fix incorrect unhooking for UI manager views in RCTProfileUnhookModules (#25042) 2019-05-31 12:47:29 -07:00
UIUtils Calculate Correct Window Dimensions for iOS (#19932) 2019-04-10 14:25:14 -07:00
Views Do not override ActivityIndicator color when setting its size (#25849) 2019-07-30 04:31:24 -07:00
React-RCTFabric.podspec Remove 's.static_framework = true' requirement for podspec (#25816) 2019-07-25 11:46:43 -07:00
third-party.xcconfig Upgrade folly to v2018.10.22.00 for iOS (#21976) 2018-10-29 12:13:11 -07:00