Removed some memory leaks

This commit is contained in:
2026-01-12 22:09:07 +01:00
parent 37c6609ba9
commit 576a590104
28 changed files with 1117 additions and 589 deletions

View File

@@ -3,7 +3,7 @@
<TargetFramework>netstandard2.1</TargetFramework>
<GeneratePackageOnBuild>true</GeneratePackageOnBuild>
<PackageId>EonaCat.Logger.LogClient</PackageId>
<Version>1.0.1</Version>
<Version>1.0.2</Version>
<Authors>EonaCat (Jeroen Saey)</Authors>
<Description>Logging client for the EonaCat Logger LogServer</Description>
<PackageTags>logging;monitoring;analytics;diagnostics</PackageTags>
@@ -25,7 +25,7 @@
</None>
</ItemGroup>
<ItemGroup>
<PackageReference Include="EonaCat.Logger" Version="1.5.2" />
<PackageReference Include="EonaCat.Logger" Version="1.5.3" />
<PackageReference Include="System.Net.Http.Json" Version="10.0.1" />
</ItemGroup>
<ItemGroup>

View File

@@ -93,7 +93,10 @@ namespace EonaCat.Logger.LogClient
private async Task FlushAsync()
{
if (_logQueue.IsEmpty) return;
if (_logQueue.IsEmpty)
{
return;
}
await _flushSemaphore.WaitAsync();
try
@@ -166,7 +169,10 @@ namespace EonaCat.Logger.LogClient
public void Dispose()
{
if (_disposed) return;
if (_disposed)
{
return;
}
_flushTimer?.Dispose();
FlushAsync().GetAwaiter().GetResult();