mirror of
https://github.com/adamhathcock/sharpcompress.git
synced 2026-02-04 05:25:00 +00:00
[PR #1152] [MERGED] Fix dispose methods to always set _isDisposed and call base.Dispose() when LeaveOpen is true #1587
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/adamhathcock/sharpcompress/pull/1152
Author: @Copilot
Created: 1/22/2026
Status: ✅ Merged
Merged: 1/22/2026
Merged by: @adamhathcock
Base:
adam/async-creation← Head:copilot/sub-pr-1132📝 Commits (3)
b4f949bInitial plan336a8f2Fix SharpCompressStream Dispose methods to set _isDisposed and call base.Dispose even when LeaveOpen is trued9be638Address code review feedback - remove extra blank lines and use consistent property access📊 Changes
2 files changed (+10 additions, -3 deletions)
View changed files
📝
src/SharpCompress/IO/SharpCompressStream.Async.cs(+5 -2)📝
src/SharpCompress/IO/SharpCompressStream.cs(+5 -1)📄 Description
The dispose logic in
SharpCompressStreamreturned early whenLeaveOpenwas true without setting_isDisposedor callingbase.Dispose(), allowing subsequent dispose calls to re-execute disposal code.Changes:
Dispose()andDisposeAsync()to always set_isDisposedand call base disposal methodsLeaveOpencheck now only guards wrapped stream disposal and buffer cleanupBefore:
After:
✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.