mirror of
https://github.com/zhigang1992/react-native.git
synced 2026-05-28 08:07:25 +08:00
Summary: Sometimes, when we deal with ImageRequest and ImageResponseObserverCoordinator we subscribe for status (or access the coordinator) without owning an ImageRequest. In those cases, we have to retain the coordinator explicitly. For those cases, ImageRequest now exposes `ImageResponseObserverCoordinator` as a `std::shared_ptr`. Eg, concretely in the code, `completionBlock` and `progressBlock` copied a raw pointer to the observer inside which can lead to a crash when ImageRequest is being deallocated before we received an image data. Reviewed By: JoshuaGross Differential Revision: D14072079 fbshipit-source-id: e10120bc05bf685e288f7b3d69092714dcd91d43