From 16afda22825776b8e79bfcc5aef367a5ce3a042b Mon Sep 17 00:00:00 2001 From: Valentin Shergin Date: Thu, 1 Oct 2020 09:36:03 -0700 Subject: [PATCH] Fabric: Making `RCTFabricSurface` to hold a `RCTSurfacePresenter` weakly Summary: With this change a RCTFabricSurface instance will not longer to hold a `RCTSurfacePresenter`. This change will enforce the guarantee that retaining a `RCTFabricSurface` is not enough for the service to run (something also should retain a `RCTSurfacePresenter`). For now it's a very small fix that should not anything, but this is a crusial part of some changes I am working on (one aspect of which implied calling unregistration in a `RCTFabricSurface`'s destructor). I need to decouple this part to test this change earlier and decouple this part of the complexity from the future diffs. Changelog: [Internal] Fabric-specific internal change. Reviewed By: sammy-SC Differential Revision: D24039581 fbshipit-source-id: c289ae057f0cd5b438f0aa9a1eb8577e1e00b39c --- React/Fabric/Surface/RCTFabricSurface.mm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/React/Fabric/Surface/RCTFabricSurface.mm b/React/Fabric/Surface/RCTFabricSurface.mm index 9cd25cd8318..728bdcf0f8e 100644 --- a/React/Fabric/Surface/RCTFabricSurface.mm +++ b/React/Fabric/Surface/RCTFabricSurface.mm @@ -24,7 +24,7 @@ using namespace facebook::react; @implementation RCTFabricSurface { // Immutable - RCTSurfacePresenter *_surfacePresenter; + __weak RCTSurfacePresenter *_surfacePresenter; NSString *_moduleName; // Protected by the `_mutex`