@@ -732,9 +732,8 @@ public void attachRootView(ReactRootView rootView) {
732
732
@ ThreadConfined (UI )
733
733
public void detachRootView (ReactRootView rootView ) {
734
734
UiThreadUtil .assertOnUiThread ();
735
- if (mAttachedRootViews .contains (rootView )) {
735
+ if (mAttachedRootViews .remove (rootView )) {
736
736
ReactContext currentContext = getCurrentReactContext ();
737
- mAttachedRootViews .remove (rootView );
738
737
if (currentContext != null && currentContext .hasActiveCatalystInstance ()) {
739
738
detachViewFromInstance (rootView , currentContext .getCatalystInstance ());
740
739
}
@@ -960,22 +959,22 @@ private void setupReactContext(final ReactApplicationContext reactContext) {
960
959
Systrace .beginSection (TRACE_TAG_REACT_JAVA_BRIDGE , "setupReactContext" );
961
960
synchronized (mReactContextLock ) {
962
961
mCurrentReactContext = Assertions .assertNotNull (reactContext );
963
- CatalystInstance catalystInstance =
964
- Assertions . assertNotNull ( reactContext . getCatalystInstance ());
965
-
966
- catalystInstance . initialize ();
967
- mDevSupportManager . onNewReactContextCreated ( reactContext );
968
- mMemoryPressureRouter . addMemoryPressureListener ( catalystInstance );
969
- moveReactContextToCurrentLifecycleState ( );
970
-
971
- ReactMarker . logMarker ( ATTACH_MEASURED_ROOT_VIEWS_START );
972
- synchronized ( mAttachedRootViews ) {
973
- for ( ReactRootView rootView : mAttachedRootViews ) {
974
- attachRootViewToInstance ( rootView );
975
- }
962
+ }
963
+ CatalystInstance catalystInstance =
964
+ Assertions . assertNotNull ( reactContext . getCatalystInstance ());
965
+
966
+ catalystInstance . initialize ( );
967
+ mDevSupportManager . onNewReactContextCreated ( reactContext );
968
+ mMemoryPressureRouter . addMemoryPressureListener ( catalystInstance );
969
+ moveReactContextToCurrentLifecycleState ();
970
+
971
+ ReactMarker . logMarker ( ATTACH_MEASURED_ROOT_VIEWS_START );
972
+ synchronized ( mAttachedRootViews ) {
973
+ for ( ReactRootView rootView : mAttachedRootViews ) {
974
+ attachRootViewToInstance ( rootView );
976
975
}
977
- ReactMarker .logMarker (ATTACH_MEASURED_ROOT_VIEWS_END );
978
976
}
977
+ ReactMarker .logMarker (ATTACH_MEASURED_ROOT_VIEWS_END );
979
978
980
979
ReactInstanceEventListener [] listeners =
981
980
new ReactInstanceEventListener [mReactInstanceEventListeners .size ()];
0 commit comments