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

Honour DoNotRelease on SafeHandles #654

Merged
merged 1 commit into from
Aug 19, 2022

Conversation

elachlan
Copy link
Contributor

@elachlan elachlan commented Aug 16, 2022

Fixes #644 and possibly #91?

@elachlan
Copy link
Contributor Author

elachlan commented Aug 17, 2022

CC: @lonitra I guess this isn't useful to you since safehandle overloads are disabled in winforms now.

@elachlan
Copy link
Contributor Author

CC: @AArnott

Copy link
Member

@AArnott AArnott left a comment

Choose a reason for hiding this comment

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

Perfect. I wish there was a good way to test this, but I gave it a quick try and unfortunately there is no public API on SafeHandle that exposes the second argument passed to its constructor. And a syntax-level test would be very brittle.

@AArnott AArnott linked an issue Aug 19, 2022 that may be closed by this pull request
@AArnott AArnott merged commit 22521d1 into microsoft:main Aug 19, 2022
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.

GetModuleHandle shouldn't return FreeLibrarySafeHandle GetStdHandle shouldn't return a CloseHandleSafeHandle
2 participants