Skip to content
This repository has been archived by the owner on Apr 9, 2024. It is now read-only.

Commit

Permalink
Fix broken asynchronous extraction.
Browse files Browse the repository at this point in the history
  • Loading branch information
squid-box committed Apr 3, 2023
1 parent bdb6e96 commit c571eaf
Showing 1 changed file with 22 additions and 23 deletions.
45 changes: 22 additions & 23 deletions SevenZip/SevenZipExtractorAsynchronous.cs
Original file line number Diff line number Diff line change
Expand Up @@ -13,32 +13,31 @@ partial class SevenZipExtractor
/// </summary>
private void RecreateInstanceIfNeeded()
{
if (!NeedsToBeRecreated)
if (NeedsToBeRecreated)
{
return;
}

Stream backupStream = null;
string backupFileName = null;

if (string.IsNullOrEmpty(_fileName))
{
backupStream = _inStream;
}
else
{
backupFileName = _fileName;
}
NeedsToBeRecreated = false;
Stream backupStream = null;
string backupFileName = null;

CommonDispose();
if (string.IsNullOrEmpty(_fileName))
{
backupStream = _inStream;
}
else
{
backupFileName = _fileName;
}

if (backupStream == null)
{
Init(backupFileName);
}
else
{
Init(backupStream);
CommonDispose();

if (backupStream == null)
{
Init(backupFileName);
}
else
{
Init(backupStream);
}
}
}

Expand Down

0 comments on commit c571eaf

Please sign in to comment.