mirror of
https://github.com/dotnet/MQTTnet.git
synced 2026-10-18 02:13:00 +08:00
Dispose queue in managed client.
This commit is contained in:
@@ -252,6 +252,7 @@ namespace MQTTnet.Extensions.ManagedClient
|
|||||||
_maintainConnectionTask = null;
|
_maintainConnectionTask = null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
_messageQueue.Dispose();
|
||||||
_messageQueueLock.Dispose();
|
_messageQueueLock.Dispose();
|
||||||
_mqttClient.Dispose();
|
_mqttClient.Dispose();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -4,7 +4,7 @@ using System.Threading;
|
|||||||
|
|
||||||
namespace MQTTnet.Internal
|
namespace MQTTnet.Internal
|
||||||
{
|
{
|
||||||
public class BlockingQueue<TItem>
|
public class BlockingQueue<TItem> : IDisposable
|
||||||
{
|
{
|
||||||
private readonly object _syncRoot = new object();
|
private readonly object _syncRoot = new object();
|
||||||
private readonly LinkedList<TItem> _items = new LinkedList<TItem>();
|
private readonly LinkedList<TItem> _items = new LinkedList<TItem>();
|
||||||
@@ -108,5 +108,10 @@ namespace MQTTnet.Internal
|
|||||||
_items.Clear();
|
_items.Clear();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void Dispose()
|
||||||
|
{
|
||||||
|
_gate.Dispose();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user