diff --git a/Lawo.EmberPlusSharp/Model/Consumer.cs b/Lawo.EmberPlusSharp/Model/Consumer.cs index dd639ca0..d4bbd679 100644 --- a/Lawo.EmberPlusSharp/Model/Consumer.cs +++ b/Lawo.EmberPlusSharp/Model/Consumer.cs @@ -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)); @@ -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(); providerTask = this.WaitForProviderChangesAsync(); }