Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove NRE workaround and implement progress completion via event handlers #94

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

kborowinski
Copy link
Contributor

@thoemmi

  1. Use ExtractionFinished and CompressionFinished event handlers to properly complete the progress bar instance
  2. Remove the workaround for NullReferenceException on PS 7.4.0 when extracting multiple 7zip archives simultaneously  #88:
    • The cause of this issue has been identified and a PR is in the approval process. The issue was caused by race conditions where multiple threads attempted to write to the console simultaneously, leading to NullReferenceExceptions. The PR introduces additional locking mechanisms to prevent such occurrences and ensure thread-safe console access.

@thoemmi thoemmi requested a review from Copilot March 2, 2025 16:29

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

PR Overview

This PR removes the NullReferenceException workaround and implements progress completion via event handlers for both extraction and compression operations.

  • Added ExtractionFinished and CompressionFinished event handlers to update and complete the progress bar
  • Removed the try-catch block in ThreadedCmdlet.cs that handled the obsolete workaround for NREs

Reviewed Changes

File Description
7Zip4Powershell/Expand7Zip.cs Added ExtractionFinished event handler to mark extraction progress as complete.
7Zip4Powershell/Compress7Zip.cs Added CompressionFinished event handler to mark compression progress as complete.
7Zip4Powershell/ThreadedCmdlet.cs Removed obsolete try-catch block for NullReferenceException workaround.

Copilot reviewed 3 out of 3 changed files in this pull request and generated no comments.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant