Skip to content

Commit

Permalink
✅ Regenerate Android Container system test fixture
Browse files Browse the repository at this point in the history
  • Loading branch information
belemaire committed Oct 25, 2018
1 parent aa96146 commit 060c602
Showing 1 changed file with 12 additions and 6 deletions.
Expand Up @@ -18,7 +18,9 @@
import com.facebook.react.modules.core.DefaultHardwareBackBtnHandler;
import com.facebook.react.modules.core.PermissionListener;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

import javax.annotation.Nullable;
Expand Down Expand Up @@ -54,7 +56,7 @@ public void invokeDefaultOnBackPressed() {
/**
* List of ReactRootView(s) holding the view containing the ReactNative application(s)
*/
private Map<String, ReactRootView> mReactRootViews = new HashMap<>();
private final Map<String, ReactRootView> mReactRootViews = new HashMap<>();

/**
* Call this constructor if you are having one activity hosting one react native application.
Expand Down Expand Up @@ -318,11 +320,15 @@ private Activity getPlainActivity() {
return ((Activity) getContext());
}

private void unMountReactApplications() {
for (Map.Entry<String, ReactRootView> entry : mReactRootViews.entrySet()) {
ReactRootView rootView = entry.getValue();
rootView.unmountReactApplication();
private void unMountReactApplications() {
List<ReactRootView> list;
synchronized (mReactRootViews) {
list = new ArrayList<>(mReactRootViews.values());
mReactRootViews.clear();
}

for (ReactRootView reactRootView : list) {
reactRootView.unmountReactApplication();
}
mReactRootViews.clear();
}
}

0 comments on commit 060c602

Please sign in to comment.