From a18a2de4b44c7651f040e45522f9ca4bb4aafd07 Mon Sep 17 00:00:00 2001 From: Samuel Susla Date: Fri, 4 Jun 2021 11:52:04 -0700 Subject: [PATCH] Fix crash in ~Pointer by not retaining LayoutManager beyond the runtime Summary: Changelog: [internal] This is a life cycle issue where LayoutManager outlives the runtime. To fix this, we need to destroy `_accessibilityProvider` before the runtime. The way to do it is to destroy it inside `prepareForReuse` which is guaranteed to be called before runtime is destroyed. Reviewed By: JoshuaGross Differential Revision: D28898257 fbshipit-source-id: 9d2c0b9cebd9889caa4328f9ee7f005928bbf55a --- .../Mounting/ComponentViews/Text/RCTParagraphComponentView.mm | 1 + 1 file changed, 1 insertion(+) diff --git a/React/Fabric/Mounting/ComponentViews/Text/RCTParagraphComponentView.mm b/React/Fabric/Mounting/ComponentViews/Text/RCTParagraphComponentView.mm index 54c5178e24e..53dfe92b9a1 100644 --- a/React/Fabric/Mounting/ComponentViews/Text/RCTParagraphComponentView.mm +++ b/React/Fabric/Mounting/ComponentViews/Text/RCTParagraphComponentView.mm @@ -108,6 +108,7 @@ using namespace facebook::react; { [super prepareForRecycle]; _state.reset(); + _accessibilityProvider = nil; } - (void)drawRect:(CGRect)rect