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

Dispose Cursor only if it is owned by the creator. #8865

Merged
merged 3 commits into from
Mar 17, 2023

Conversation

dreddy-work
Copy link
Member

@dreddy-work dreddy-work commented Mar 16, 2023

While investigating flaky tests, found that Cursor Handle is being set to null even if the cursor is not owned by the specific scope. This has been the case since .NET framework. Disposing handle only if owned by creator.

Some static Cursors in WinForms are incorrectly categorized as owned. Making any change around owned flag on these could break existing applications. In this change, we are recreating static cursors if their handle is disposed.

Related #8810

fixes #8373

Microsoft Reviewers: Open in CodeFlow

@dreddy-work dreddy-work requested a review from a team as a code owner March 16, 2023 22:31
@ghost ghost assigned dreddy-work Mar 16, 2023
@dreddy-work dreddy-work changed the title Dispose Cursor only if it owned by application. Dispose Cursor only if it is owned. Mar 16, 2023
@dreddy-work dreddy-work changed the title Dispose Cursor only if it is owned. Dispose Cursor only if it is owned by the creator. Mar 16, 2023
Copy link
Member

@Tanya-Solyanik Tanya-Solyanik left a comment

Choose a reason for hiding this comment

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

Looks good

@dreddy-work dreddy-work merged commit 1dc01f2 into main Mar 17, 2023
@dreddy-work dreddy-work deleted the dev/dreddy/CursorDispose branch March 17, 2023 16:39
@ghost ghost added this to the 8.0 Preview3 milestone Mar 17, 2023
@ghost ghost locked as resolved and limited conversation to collaborators Apr 16, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Flaky test: cursorconverter_convertto_unknowntoinstancedescriptor_throwsnotsupportedexception
2 participants