Now able to switch screens away from party without crashing

This commit is contained in:
watsonb8
2019-11-29 20:51:48 -05:00
parent ad1fca2009
commit e822829cc0
3 changed files with 21 additions and 24 deletions

View File

@ -74,9 +74,6 @@ namespace Aurora.Services.ClientService
_remoteEventsClient = new RemoteEventService.RemoteEventServiceClient(_channel);
_remotePlaybackClient = new RemotePlaybackService.RemotePlaybackServiceClient(_channel);
_remoteSyncClient = new RemoteSyncService.RemoteSyncServiceClient(_channel);
//Assign but don't start task
_eventCancellationTokenSource = new CancellationTokenSource();
}
public async void Close()
@ -96,6 +93,7 @@ namespace Aurora.Services.ClientService
/// <returns></returns>
public async Task GetEvents()
{
_eventCancellationTokenSource = new CancellationTokenSource();
string clientId = SettingsService.Instance.ClientId;
Console.WriteLine(string.Format("CLIENT {0} - GetEvents called from client with id", clientId));
using (AsyncServerStreamingCall<BaseEvent> eventStream = _remoteEventsClient