private async Task TearDownReactContextAsync(ReactContext reactContext, CancellationToken token) { token.ThrowIfCancellationRequested(); DispatcherHelpers.AssertOnDispatcher(); _lifecycleStateMachine.SetContext(null); foreach (var rootView in _attachedRootViews) { rootView.CleanupSafe(); } await reactContext.DisposeAsync(); _devSupportManager.OnReactContextDestroyed(reactContext); // TODO: add memory pressure hooks }
private async Task TearDownReactContextAsync(ReactContext reactContext) { DispatcherHelpers.AssertOnDispatcher(); if (_lifecycleState == LifecycleState.Resumed) { reactContext.OnSuspend(); } foreach (var rootView in _attachedRootViews) { DetachViewFromInstance(rootView, reactContext.ReactInstance); } await reactContext.DisposeAsync(); _devSupportManager.OnReactContextDestroyed(reactContext); // TODO: add memory pressure hooks }
private async Task TearDownReactContextAsync(ReactContext reactContext, CancellationToken token) { token.ThrowIfCancellationRequested(); DispatcherHelpers.AssertOnDispatcher(); if (_lifecycleState == LifecycleState.Resumed) { reactContext.OnSuspend(); } foreach (var rootView in _attachedRootViews) { rootView.Children.Clear(); rootView.ClearData(); } await reactContext.DisposeAsync(); _devSupportManager.OnReactContextDestroyed(reactContext); // TODO: add memory pressure hooks }
private async Task TearDownReactContextAsync(ReactContext reactContext) { DispatcherHelpers.AssertOnDispatcher(); if (_lifecycleState == LifecycleState.Resumed) { reactContext.OnSuspend(); } foreach (var rootView in _attachedRootViews) { DetachViewFromInstance(rootView, reactContext.ReactInstance); } await reactContext.DisposeAsync(); _devSupportManager.OnReactContextDestroyed(reactContext); // TODO: add memory pressure hooks }