Reviewed By: javache

Differential Revision: D5103275

fbshipit-source-id: 1df50ecef7b16289eecadde3c193db086eef1fc7
This commit is contained in:
Aaron Chiu 2017-05-22 03:10:26 -07:00 коммит произвёл Facebook Github Bot
Родитель 130a82101c
Коммит 784f89d0c9
1 изменённых файлов: 7 добавлений и 6 удалений

Просмотреть файл

@ -236,8 +236,8 @@ public class ReactRootView extends SizeMonitoringFrameLayout implements RootView
/** /**
* Unmount the react application at this root view, reclaiming any JS memory associated with that * Unmount the react application at this root view, reclaiming any JS memory associated with that
* application. If {@link #startReactApplication} is called, this method must be called before the * application. If {@link #startReactApplication} is called, this method must be called before the
* ReactRootView is garbage collected (typically in your Activity's onDestroy, or in your Fragment's * ReactRootView is garbage collected (typically in your Activity's onDestroy, or in your
* onDestroyView). * Fragment's onDestroyView).
*/ */
public void unmountReactApplication() { public void unmountReactApplication() {
if (mReactInstanceManager != null && mIsAttachedToInstance) { if (mReactInstanceManager != null && mIsAttachedToInstance) {
@ -339,10 +339,11 @@ public class ReactRootView extends SizeMonitoringFrameLayout implements RootView
super.finalize(); super.finalize();
Assertions.assertCondition( Assertions.assertCondition(
!mIsAttachedToInstance, !mIsAttachedToInstance,
"The application this ReactRootView was rendering was not unmounted before the ReactRootView " + "The application this ReactRootView was rendering was not unmounted before the " +
"was garbage collected. This usually means that your application is leaking large amounts of " + "ReactRootView was garbage collected. This usually means that your application is " +
"memory. To solve this, make sure to call ReactRootView#unmountReactApplication in the onDestroy() " + "leaking large amounts of memory. To solve this, make sure to call " +
"of your hosting Activity or in the onDestroyView() of your hosting Fragment."); "ReactRootView#unmountReactApplication in the onDestroy() of your hosting Activity or in " +
"the onDestroyView() of your hosting Fragment.");
} }
public int getRootViewTag() { public int getRootViewTag() {