react-native/React
Valentin Shergin e61a14e71d Fabric: RCTWeakEventEmitterWrapper, NSAttributedString and co.
Summary:
Previously, we stored a pointer to ShadowNode inside NSAttributedString's attributes to make possible retrieving an EventEmitter associated with some text fragment.
That worked fine besides only one caveat: the internal implementation of NSAttributedString is quite strange and that causes a memory leak. Because of some reason, NSAttributedString does not release stored attributes after own destruction (maybe OS uses some kind of caching).
So, now, instead of storing a strong pointer to ShadowNode inside NSAttributedString, we store a weak pointer to EventEmitter. Storing a weak pointer is okay because a desired lifetime of EventEmitter is guaranteed by LocalData stored inside a View. Storing a weak EventEmitter instead of weak ShadowNode will also help us with migration to ShadowView (we cannot store ShadowView weakly because it's a stack allocated object).

Reviewed By: sahrens

Differential Revision: D13196886

fbshipit-source-id: f8714e4b3709765629d6456edf0c635bf5f7c53b
2018-11-26 13:51:19 -08:00
..
Base iOS TM: RCTEnableJSINativeModule => RCTEnableTurboModule 2018-11-20 01:20:59 -08:00
CxxBridge iOS TM: Rename RCTJSINativeModule => RCTTurboModule 2018-11-14 10:42:04 -08:00
CxxModule iOS changes to switch to JSI 2018-10-18 01:06:24 -07:00
CxxUtils Update copyright headers to yearless format 2018-09-11 15:33:07 -07:00
DevSupport RN: Missing Copyright Headers 2018-10-31 01:37:26 -07:00
Fabric Fabric: RCTWeakEventEmitterWrapper, NSAttributedString and co. 2018-11-26 13:51:19 -08:00
Inspector RN: Missing Copyright Headers 2018-10-31 01:37:26 -07:00
Modules iOS: Support inline view truncation (#21456) 2018-11-20 00:11:56 -08:00
Profiler Update copyright headers to yearless format 2018-09-11 15:33:07 -07:00
React.xcodeproj Fix Xcode 10 builds (broken by folly upgrade) (#22394) 2018-11-26 01:41:15 -08:00
UIUtils Update copyright headers to yearless format 2018-09-11 15:33:07 -07:00
Views create api to allow clients to present a client credential for authentication (#22316) 2018-11-16 18:44:35 -08:00
.clang-format Defining explicit clang-format for Objective-C part of React Native 2018-11-15 20:28:14 -08:00
third-party.xcconfig Upgrade folly to v2018.10.22.00 for iOS (#21976) 2018-10-29 12:13:11 -07:00