Fix issue when stopping server

This commit is contained in:
Christian Kratky
2017-07-15 18:36:33 +02:00
parent 2193281c6a
commit 886b2d6b42
4 changed files with 9 additions and 3 deletions
+4 -1
View File
@@ -185,7 +185,10 @@ namespace MQTTnet.Core.Client
}
finally
{
_cancellationTokenSource?.Cancel();
_cancellationTokenSource?.Cancel(false);
_cancellationTokenSource?.Dispose();
_cancellationTokenSource = null;
IsConnected = false;
Disconnected?.Invoke(this, EventArgs.Empty);
}