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
This commit is contained in:
Valentin Shergin
2020-10-01 09:36:03 -07:00
committed by Facebook GitHub Bot
parent edbe154a30
commit 16afda2282
+1 -1
View File
@@ -24,7 +24,7 @@ using namespace facebook::react;
@implementation RCTFabricSurface {
// Immutable
RCTSurfacePresenter *_surfacePresenter;
__weak RCTSurfacePresenter *_surfacePresenter;
NSString *_moduleName;
// Protected by the `_mutex`