Skip to content

Commit

Permalink
Make sure everything is cancelled when Dispose is called
Browse files Browse the repository at this point in the history
References #21
  • Loading branch information
andreashuber-lawo committed Apr 29, 2016
1 parent 6178f65 commit 16a7605
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion Lawo.EmberPlusSharp/Model/Consumer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,7 @@ public void Dispose()
this.root.HasChangesSet -= this.OnHasChangesSet;
this.client.ConnectionLost -= this.receiveQueue.OnConnectionLost;
this.client.EmberDataReceived -= this.receiveQueue.OnMessageReceived;
this.isVerifiedSource.TrySetCanceled();
this.hasChangesSetSource.TrySetCanceled();
this.CancelAutoSendDelay();
this.receiveQueue.OnConnectionLost(this, new ConnectionLostEventArgs(null));
Expand Down Expand Up @@ -320,7 +321,7 @@ private async void SendReceiveLoop()
await providerTask;
this.ApplyProviderChanges();
await this.RetrieveChildrenAsync();
this.isVerifiedSource.SetResult(false);
this.isVerifiedSource.TrySetResult(false);
this.isVerifiedSource = new TaskCompletionSource<bool>();
providerTask = this.WaitForProviderChangesAsync();
}
Expand Down

0 comments on commit 16a7605

Please sign in to comment.