private async void OnDestroy() { await _controller?.UnregisterAsync(); await _controller?.DisposeAsync(); _controller = null; await _channel?.ShutdownAsync(); _channel = null; }
protected override async void OnClosed(EventArgs e) { base.OnClosed(e); (_unityLibrary as IDisposable)?.Dispose(); _unityLibrary = null; await _controller?.UnregisterAsync(); await _controller?.DisposeAsync(); _controller = null; await _channel?.ShutdownAsync(); }