mirror of
https://github.com/adamhathcock/sharpcompress.git
synced 2026-02-04 05:25:00 +00:00
[PR #1152] Fix dispose methods to always set _isDisposed and call base.Dispose() when LeaveOpen is true #1592
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?
Original Pull Request: https://github.com/adamhathcock/sharpcompress/pull/1152
State: closed
Merged: Yes
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.