Prevent reporting mount when FabricUIManager has been destroyed (#43099)

Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/43099

In all methods of FabricUIManager we check whether it's been destroyed before doing any logic, but we don't in this asynchronous method we're scheduling to report mounts.

This adds the check in that case as well to potentially fix some crashes we're seeing in current experiments for mount hooks on Android.

Changelog: [internal]

Reviewed By: sammy-SC

Differential Revision: D53920863

fbshipit-source-id: 3cc18cf5237d4866940739de80cc00604bcd0fb6
This commit is contained in:
Rubén Norte
2024-02-20 07:37:29 -08:00
committed by Facebook GitHub Bot
parent c99d96b7a1
commit 1fc2a5a4c9
@@ -1231,6 +1231,10 @@ public class FabricUIManager implements UIManager, LifecycleEventListener {
public void run() {
mMountNotificationScheduled.set(false);
if (mDestroyed) {
return;
}
final @Nullable Binding binding = mBinding;
if (mountItems == null || binding == null) {
return;