fix: Fixes libdeflate threading issue (#1813)

This commit is contained in:
Kamron Batman 2024-06-02 15:02:47 -07:00 committed by GitHub
parent aeba2261d2
commit a8d3d2773e
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 8 additions and 11 deletions

View file

@ -25,6 +25,7 @@ using System.Text;
using System.Text.Json;
using System.Threading;
using System.Threading.Tasks;
using Server.Compression;
using Server.Json;
using Server.Logging;
using Server.Network;
@ -465,6 +466,10 @@ public static class Core
Console.CancelKeyPress += Console_CancelKeyPressed;
// LibDeflate is not thread safe, so we need to create a new instance for each thread
var standard = Deflate.Standard;
AppDomain.CurrentDomain.ProcessExit += (_, _) => standard.Dispose();
ServerConfiguration.Load();
logger.Information("Running on {Framework}", RuntimeInformation.FrameworkDescription);