fix: Adds dispose call to LibDeflateBinding on process exits (#1784)

This commit is contained in:
Stefano Merotta 2024-05-21 22:40:03 +02:00 committed by GitHub
parent 00908d030f
commit 50d3779d9b
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 16 additions and 4 deletions

View file

@ -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 <http://www.gnu.org/licenses/>. *
*************************************************************************/
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();
}
}

View file

@ -35,7 +35,7 @@
</Target>
<ItemGroup>
<PackageReference Include="CommunityToolkit.HighPerformance" Version="8.2.2" />
<PackageReference Include="LibDeflate.Bindings" Version="1.0.0.120" />
<PackageReference Include="LibDeflate.Bindings" Version="1.0.1.120" />
<PackageReference Include="PollGroup" Version="1.4.3" />
<PackageReference Include="System.IO.Hashing" Version="8.0.0" />

View file

@ -34,7 +34,7 @@
<ProjectReference Include="..\Server\Server.csproj" Private="false" PrivateAssets="All" IncludeAssets="None">
<IncludeInPackage>false</IncludeInPackage>
</ProjectReference>
<PackageReference Include="LibDeflate.Bindings" Version="1.0.0.120" />
<PackageReference Include="LibDeflate.Bindings" Version="1.0.1.120" />
<PackageReference Include="MailKit" Version="4.6.0" />
<PackageReference Include="Microsoft.Extensions.FileSystemGlobbing" Version="8.0.0" />
<PackageReference Include="CommunityToolkit.HighPerformance" Version="8.2.2" />