-
Notifications
You must be signed in to change notification settings - Fork 1k
Dispose Cursor in tests #8793
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 in tests #8793
Conversation
@@ -33,7 +33,7 @@ public class CursorTestsFixture : IDisposable | |||
public void Cursor_Ctor_IntPtr() | |||
{ | |||
Cursor sourceCursor = Cursors.AppStarting; | |||
var cursor = new Cursor(sourceCursor.Handle); | |||
using var cursor = new Cursor(sourceCursor.Handle); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is not really needed because cursor
does not own the handle, but this looks consistent.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
should be safe with #8865
System.Windows.Forms.UITests.ButtonTests.Button_DialogResult_ClickDefaultButtonToCloseFormAsync(dialogResult: Retry) at System.Windows.Forms.UITests.ButtonTests.<>c__DisplayClass1_0.<<Button_DialogResult_ClickDefaultButtonToCloseFormAsync>b__0>d.MoveNext() in //src/System.Windows.Forms/tests/IntegrationTests/UIIntegrationTests/ButtonTests.cs:line 49 |
System.Windows.Forms.UITests.ButtonTests.Button_Mouse_Press_With_Drag_Off_Button_And_Back_Does_Cause_Button_ClickAsync Assert.Equal() Failure\r\nExpected: 1\r\nActual: 0 at System.Windows.Forms.UITests.ButtonTests.<Button_Mouse_Press_With_Drag_Off_Button_And_Back_Does_Cause_Button_ClickAsync>b__11_0(Form form, ValueTuple |
/azp run |
Azure Pipelines successfully started running 2 pipeline(s). |
Proposed changes
Microsoft Reviewers: Open in CodeFlow