]> git.deb.at Git - rhonda/impostor.hazel.git/commitdiff
Fix disposal issues in ThreadLimitedUdpConnectionListener
authorMatthew Endsley <mendsley@gmail.com>
Wed, 16 Dec 2020 21:30:24 +0000 (13:30 -0800)
committerMatthew Endsley <mendsley@gmail.com>
Thu, 17 Dec 2020 17:41:22 +0000 (09:41 -0800)
Hazel/FewerThreads/ThreadLimitedUdpConnectionListener.cs

index 3d59106045aaab3e95fddfe22e4a39929ad14603..fca1a8ea02e4304fe7057b8ae3b7530006a4103a 100644 (file)
@@ -308,16 +308,19 @@ namespace Hazel.Udp.FewerThreads
 
             this.isActive = false;
 
-            this.receiveQueue.CompleteAdding();
-            this.sendQueue.CompleteAdding();
+            this.receiveQueue?.CompleteAdding();
+            this.sendQueue?.CompleteAdding();
 
             this.reliablePacketThread.Join();
             this.sendThread.Join();
             this.receiveThread.Join();
             this.processThreads.Join();
 
-            this.receiveQueue.Dispose();
-            this.sendQueue.Dispose();
+            this.receiveQueue?.Dispose();
+            this.receiveQueue = null;
+            this.sendQueue?.Dispose();
+            this.sendQueue = null;
+
         }
 
         public void Dispose()