Skip to content

LeaveOpen wasn't respected by GZip#1346

Merged
adamhathcock merged 2 commits into
masterfrom
adam/gzip-leave-open
Jun 2, 2026
Merged

LeaveOpen wasn't respected by GZip#1346
adamhathcock merged 2 commits into
masterfrom
adam/gzip-leave-open

Conversation

@adamhathcock

Copy link
Copy Markdown
Owner

bugfix from: #1282

This pull request makes a small change to the GZipStream class to ensure that the LeaveStreamOpen option from readerOptions is passed when initializing the stream. This helps control whether the underlying stream remains open after the GZipStream is disposed.

Copilot AI review requested due to automatic review settings June 2, 2026 12:44

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

This PR aims to ensure IReaderOptions.LeaveStreamOpen is honored when constructing the internal GZip stream so callers can control whether the underlying stream is disposed.

Changes:

  • Pass readerOptions.LeaveStreamOpen into the GZipStream initialization call.

Issue found (blocks approval):

  • The new argument uses readerOptions.LeaveStreamOpen before the existing null-guard (readerOptions ?? throw ...) used in the subsequent argument. If readerOptions is ever null (which the guard implies is possible/expected), this now throws NullReferenceException earlier. The fix is to read LeaveStreamOpen from the same null-checked expression (or assign a local after the guard).

@adamhathcock adamhathcock merged commit 27cc668 into master Jun 2, 2026
6 checks passed
@adamhathcock adamhathcock deleted the adam/gzip-leave-open branch June 2, 2026 13:59
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.

2 participants