Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/EpicManifestParser/EpicManifestParser.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="AsyncKeyedLock" Version="7.1.4" />
<PackageReference Include="AsyncKeyedLock" Version="8.0.2" />
<PackageReference Include="Flurl" Version="4.0.0" />
<PackageReference Include="GenericReader" Version="2.2.0" />
<PackageReference Include="OffiUtils" Version="2.0.1" />
Expand Down
5 changes: 2 additions & 3 deletions src/EpicManifestParser/FFileManifestStream.cs
Original file line number Diff line number Diff line change
Expand Up @@ -561,7 +561,7 @@ internal sealed class DownloadState<TDestination> : IEnumerable<ChunkWithOffset<
public readonly TDestination Destination;
public readonly FFileManifest FileManifest;

private readonly LockObject? _lock;
private readonly LockObject _lock = new();
private readonly object? _userState;
private readonly Action<SaveProgressChangedEventArgs>? _callback;
private readonly long _totalBytesToSave;
Expand All @@ -580,7 +580,6 @@ public DownloadState(TDestination destination, FFileManifest fileManifest, long
FileManifest = fileManifest;

if (callback is null) return;
_lock = new LockObject();
_userState = userState;
_callback = callback;
_totalBytesToSave = totalBytesToSave;
Expand All @@ -591,7 +590,7 @@ public void OnBytesWritten(long amount)
if (_callback is null)
return;

lock (_lock!)
lock (_lock)
{
_bytesSaved += amount;
var progress = (int)MathF.Truncate((float)_bytesSaved / _totalBytesToSave * 100f);
Expand Down
Loading