Skip to content

Only call base.DisposeAsync on classes derived from FileStream#82874

Merged
jozkee merged 2 commits intomainfrom
fs_issue_82186_v2
Apr 4, 2023
Merged

Only call base.DisposeAsync on classes derived from FileStream#82874
jozkee merged 2 commits intomainfrom
fs_issue_82186_v2

Conversation

@jozkee
Copy link
Member

@jozkee jozkee commented Mar 2, 2023

Regression introduced on #65899.

Fixes #82176.
Fixes #82186.

@ghost
Copy link

ghost commented Mar 2, 2023

Tagging subscribers to this area: @dotnet/area-system-io
See info in area-owners.md if you want to be subscribed.

Issue Details

Regression introduced on #65899.

Fixes #82176.
Fixes #82186.

Author: Jozkee
Assignees: -
Labels:

area-System.IO

Milestone: -

Copy link
Member

@wfurt wfurt left a comment

Choose a reason for hiding this comment

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

LGTM.

I'm wondering if we can write test that verifies that the file is actually closed ... perhaps by using exclusive access and opening int again after DisposeAsync or using pipes on Unix and checking EOF. Setting the CloseInvoked may be sufficient.

@jozkee
Copy link
Member Author

jozkee commented Apr 4, 2023

I'm wondering if we can write test that verifies that the file is actually closed ... perhaps by using exclusive access and opening int again after DisposeAsync or using pipes on Unix and checking EOF.

Not saying we shouldn't but I think CloseInvoked does suffice. Thanks for the review!

@jozkee jozkee merged commit 17a3ebd into main Apr 4, 2023
@jozkee jozkee deleted the fs_issue_82186_v2 branch April 4, 2023 15:22
@ghost ghost locked as resolved and limited conversation to collaborators May 4, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

3 participants