From 8329c10932d7928a215be0a39766d2d9d1a8c3e7 Mon Sep 17 00:00:00 2001 From: David Vacca Date: Thu, 8 Nov 2018 16:55:11 -0800 Subject: [PATCH] Stop mounting of Views when there is an exception in Native Summary: This diff fixes exception handling for Mounting of views, as soon as there is an exception we stop the mounting of views because from that point the UI View tree is going to be inconsistent with the ReactShadow tree from C++. We also stop the mounting of views when the host is paused, this allows us to not keep mounting views Reviewed By: shergin Differential Revision: D10510334 fbshipit-source-id: b0d3eba580ff92d8b8400244ec9d7c266db42ff9 --- .../main/java/com/facebook/react/ReactInstanceManager.java | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/ReactAndroid/src/main/java/com/facebook/react/ReactInstanceManager.java b/ReactAndroid/src/main/java/com/facebook/react/ReactInstanceManager.java index d4a7e8efe..0f3edbf54 100644 --- a/ReactAndroid/src/main/java/com/facebook/react/ReactInstanceManager.java +++ b/ReactAndroid/src/main/java/com/facebook/react/ReactInstanceManager.java @@ -1085,11 +1085,7 @@ public class ReactInstanceManager { synchronized (mAttachedRootViews) { for (ReactRootView rootView : mAttachedRootViews) { - if (rootView.getUIManagerType() != FABRIC) { - // All the views created in surfaces that are managed by Fabric, are removed and deleted - // by the Mounting Layer. - rootView.removeAllViews(); - } + rootView.removeAllViews(); rootView.setId(View.NO_ID); } }