mirror of
https://github.com/facebook/react-native.git
synced 2025-11-01 09:14:26 +00:00
Stop all surfaces when tearing down FabricUIManager
Summary: Teardown any remaining surfaces when tearing down FabricUIManager. Changelog: [Internal] Reviewed By: mdvacca Differential Revision: D21774541 fbshipit-source-id: cfd544f1721599521e0fd6677d45208e51b8340d
This commit is contained in:
committed by
Facebook GitHub Bot
parent
983b0a0903
commit
8a02450fbb
@@ -89,4 +89,7 @@ public class ReactFeatureFlags {
|
||||
|
||||
/** Feature flag to configure initialization of Fabric surfaces. */
|
||||
public static boolean enableFabricStartSurfaceWithLayoutMetrics = true;
|
||||
|
||||
/** Feature flag to have FabricUIManager teardown stop all active surfaces. */
|
||||
public static boolean enableFabricStopAllSurfacesOnTeardown = false;
|
||||
}
|
||||
|
||||
@@ -286,6 +286,15 @@ public class FabricUIManager implements UIManager, LifecycleEventListener {
|
||||
// memory immediately.
|
||||
mDispatchUIFrameCallback.stop();
|
||||
|
||||
// Stop all attached surfaces
|
||||
if (ReactFeatureFlags.enableFabricStopAllSurfacesOnTeardown) {
|
||||
FLog.e(TAG, "stop all attached surfaces");
|
||||
for (int surfaceId : mReactContextForRootTag.keySet()) {
|
||||
FLog.e(TAG, "stop attached surface: " + surfaceId);
|
||||
stopSurface(surfaceId);
|
||||
}
|
||||
}
|
||||
|
||||
mBinding.unregister();
|
||||
mBinding = null;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user