diff --git a/Server/Services/PacketDistributorService.cs b/Server/Services/PacketDistributorService.cs index 5b3e6aa..1d19c40 100644 --- a/Server/Services/PacketDistributorService.cs +++ b/Server/Services/PacketDistributorService.cs @@ -23,7 +23,7 @@ namespace Server.Services; using static CodeGenerator; using static ExpressionBuilder; -public class PacketDistributorService : IHostedService +public class PacketDistributorService : IHostedService, IDisposable { private readonly ConcurrentQueue _concurrentQueue; @@ -178,4 +178,10 @@ public class PacketDistributorService : IHostedService _logger.PacketData(JsonConvert.SerializeObject(packet)); _logger.PacketFinished(item.Session.Id, item.OperationCode); } + + public void Dispose() + { + GC.SuppressFinalize(this); + _activitySource.Dispose(); + } }