diff --git a/Projects/Server/Compression/Deflate.cs b/Projects/Server/Compression/Deflate.cs
index 0442794c4..6810ef7d6 100644
--- a/Projects/Server/Compression/Deflate.cs
+++ b/Projects/Server/Compression/Deflate.cs
@@ -1,4 +1,4 @@
-/*************************************************************************
+/*************************************************************************
* ModernUO *
* Copyright 2019-2024 - ModernUO Development Team *
* Email: hi@modernuo.com *
@@ -13,11 +13,23 @@
* along with this program. If not, see . *
*************************************************************************/
+using System;
using System.IO.Compression;
namespace Server.Compression;
public static class Deflate
{
- public static LibDeflateBinding Standard { get; } = new();
+ public static LibDeflateBinding Standard { get; }
+
+ static Deflate()
+ {
+ Standard = new LibDeflateBinding();
+ AppDomain.CurrentDomain.ProcessExit += CurrentDomain_ProcessExit;
+ }
+
+ private static void CurrentDomain_ProcessExit(object sender, EventArgs e)
+ {
+ Standard.Dispose();
+ }
}
diff --git a/Projects/Server/Server.csproj b/Projects/Server/Server.csproj
index acac1aea1..c68dda346 100755
--- a/Projects/Server/Server.csproj
+++ b/Projects/Server/Server.csproj
@@ -35,7 +35,7 @@
-
+
diff --git a/Projects/UOContent/UOContent.csproj b/Projects/UOContent/UOContent.csproj
index 4fce86e72..e53ef779c 100644
--- a/Projects/UOContent/UOContent.csproj
+++ b/Projects/UOContent/UOContent.csproj
@@ -34,7 +34,7 @@
false
-
+