Fabric: Attempt to fix a crash in RCTMountingTransactionObserverCoordinator

Summary:
We see a quite small but probably dangerous crash in RCTMountingTransactionObserverCoordinator, it's unclear why exactly it happens but seems it's somehow connected with a shape of RCTComponentViewDescriptor struct.
Specifying storage attribute (`__strong`) correctly/explicitly might fix the issue.

Changelog: [Internal] Fabric-specific internal change.

Reviewed By: sammy-SC

Differential Revision: D18567763

fbshipit-source-id: 57d9f96c4609a38ddf44ce02df53f2d713dfb116
This commit is contained in:
Valentin Shergin
2019-11-19 09:48:48 -08:00
committed by Facebook Github Bot
parent 6db52c5fe0
commit 83f0210cee
2 changed files with 2 additions and 2 deletions
@@ -21,7 +21,7 @@ class RCTComponentViewDescriptor final {
/*
* Associated (and owned) native view instance.
*/
UIView<RCTComponentViewProtocol> *view;
__strong UIView<RCTComponentViewProtocol> *view = nil;
/*
* Indicates a requirement to call on the view methods from
+1 -1
View File
@@ -46,7 +46,7 @@ static void RNDeleteMountInstruction(
SurfaceId surfaceId)
{
auto const &oldChildShadowView = mutation.oldChildShadowView;
RCTComponentViewDescriptor componentViewDescriptor = [registry componentViewDescriptorWithTag:oldChildShadowView.tag];
auto const &componentViewDescriptor = [registry componentViewDescriptorWithTag:oldChildShadowView.tag];
observerCoordinator.unregisterViewComponentDescriptor(componentViewDescriptor, surfaceId);
[registry enqueueComponentViewWithComponentHandle:oldChildShadowView.componentHandle
tag:oldChildShadowView.tag