From a152066ed34bd5d8114cbbecf82d183316d84bfd Mon Sep 17 00:00:00 2001 From: JanEggers Date: Sat, 4 Jan 2020 11:54:41 +0100 Subject: [PATCH] fixed managed client so it does not send disconnect packet when disposed --- Source/MQTTnet/Internal/Disposable.cs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/Source/MQTTnet/Internal/Disposable.cs b/Source/MQTTnet/Internal/Disposable.cs index f8a72b5..2ce3423 100644 --- a/Source/MQTTnet/Internal/Disposable.cs +++ b/Source/MQTTnet/Internal/Disposable.cs @@ -44,12 +44,13 @@ namespace MQTTnet.Internal { return; } + + _isDisposed = true; + // Do not change this code. Put cleanup code in Dispose(bool disposing) above. Dispose(true); // TODO: uncomment the following line if the finalizer is overridden above. // GC.SuppressFinalize(this); - - _isDisposed = true; } #endregion }