fix: Fixes libdeflate threading issue (#1813)
This commit is contained in:
parent
aeba2261d2
commit
a8d3d2773e
2 changed files with 8 additions and 11 deletions
|
|
@ -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);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue