build fixes

This commit is contained in:
Adam Hathcock
2026-02-16 11:03:59 +00:00
parent eca7bcb515
commit 5c1547c284
4 changed files with 26 additions and 3 deletions

View File

@@ -192,6 +192,7 @@ internal class AsyncMarkingBinaryReader : IDisposable
}
public virtual void Dispose() => _reader.Dispose();
#if NET8_0_OR_GREATER
public virtual ValueTask DisposeAsync() => _reader.DisposeAsync();
#endif

View File

@@ -9,8 +9,17 @@ using SharpCompress.Compressors.LZMA.RangeCoder;
namespace SharpCompress.Compressors.LZMA;
public partial class Decoder : ICoder, ISetDecoderProperties
public partial class Decoder : IAsyncDisposable
{
public async ValueTask DisposeAsync()
{
if (_outWindow is not null)
{
await _outWindow.DisposeAsync().ConfigureAwait(false);
_outWindow = null;
}
}
partial class LenDecoder
{
public async ValueTask<uint> DecodeAsync(

View File

@@ -9,8 +9,14 @@ using SharpCompress.Compressors.LZMA.RangeCoder;
namespace SharpCompress.Compressors.LZMA;
public partial class Decoder : ICoder, ISetDecoderProperties // ,System.IO.Stream
public partial class Decoder : ICoder, ISetDecoderProperties, IDisposable
{
public void Dispose()
{
_outWindow?.Dispose();
_outWindow = null;
}
private partial class LenDecoder
{
private BitDecoder _choice = new();

View File

@@ -1,4 +1,6 @@
#if LEGACY_DOTNET
using System;
#if LEGACY_DOTNET
namespace SharpCompress;
@@ -10,4 +12,9 @@ internal static class StringExtensions
internal static bool Contains(this string text, char value) => text.IndexOf(value) > -1;
}
[AttributeUsage(
AttributeTargets.Parameter | AttributeTargets.Property | AttributeTargets.ReturnValue
)]
public class NotNullAttribute : Attribute;
#endif