properly clean up ReactAppTestActivity

Reviewed By: achen1

Differential Revision: D5183260

fbshipit-source-id: 263a289ff2332b39693830f77e705544e10b18ff
This commit is contained in:
Aaron Chiu 2017-06-05 13:01:05 -07:00 committed by Facebook Github Bot
parent 844a18fb25
commit e9e2de0ca2

View File

@ -99,6 +99,11 @@ public class ReactAppTestActivity extends FragmentActivity implements
if (mReactInstanceManager != null) {
mReactInstanceManager.destroy();
mReactInstanceManager = null;
}
if (mReactRootView != null) {
mReactRootView.unmountReactApplication();
mReactRootView = null;
}
mScreenshotingFrameLayout.clean();
@ -129,6 +134,9 @@ public class ReactAppTestActivity extends FragmentActivity implements
mReactInstanceManager.destroy();
mReactInstanceManager = null;
}
if (mReactRootView != null) {
mReactRootView.unmountReactApplication();
}
mReactRootView = new ReactRootView(this);
mScreenshotingFrameLayout.removeAllViews();
mScreenshotingFrameLayout.clean();