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
This commit is contained in:
Samuel Susla
2021-06-04 11:53:18 -07:00
committed by Facebook GitHub Bot
parent d676cbe6c9
commit a18a2de4b4
@@ -108,6 +108,7 @@ using namespace facebook::react;
{
[super prepareForRecycle];
_state.reset();
_accessibilityProvider = nil;
}
- (void)drawRect:(CGRect)rect