-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Move LinkLabel text region dispose back to EnsureRun #13978
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
Conversation
Disposing in InvalidateLayout would break when accessing the links VisualRegion as it is shared. Fixes dotnet#13973
|
Writing a regression test for this isn't simple as it requires a specific sequence of Windows messages to get in the offending state. I added an assert to the Control code that was attempting to use the disposed region to hopefully flag this sort of thing earlier. |
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## main #13978 +/- ##
===================================================
- Coverage 77.15202% 77.14570% -0.00632%
===================================================
Files 3276 3276
Lines 645116 645117 +1
Branches 47705 47705
===================================================
- Hits 497720 497680 -40
- Misses 143708 143750 +42
+ Partials 3688 3687 -1
Flags with carried forward coverage won't be shown. Click here to find out more. 🚀 New features to boost your workflow:
|
Shyam-Gupta
left a comment
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.
Looks good.
|
/backport to release/10.0 |
|
Started backporting to release/10.0: https://github.com/dotnet/winforms/actions/runs/18699261623 |
…13979) Backport of #13978 to release/10.0 /cc @JeremyKuhne ## Customer Impact Changing `LinkLabel` state during events can cause the app to crash as we'll try to give GDI+ a null pointer. There is no known workaround to this as internal state can't be changed as events are being processed. A System.Drawing `Region` disposal was moved to a location that would let it get used after disposal by another holder of the Region. The fix is to move the disposal back to its original location. ## Testing Manual testing of the end users' repro. Existing automated coverage. This is not plausible to unit test as it requires a long sequence of messages to reproduce. (MouseEnter, MouseHover, MouseUp, and more.) ## Risk Low. Moving the disposal back to where it was originally, which is before the new `Region` is created and applied. ###### Microsoft Reviewers: [Open in CodeFlow](https://microsoft.github.io/open-pr/?codeflow=https://github.com/dotnet/winforms/pull/13979)
Disposing in
InvalidateLayoutwould break in some workflows when accessing theLinksVisualRegionas it is shared. This got mistakenly moved in #10448.Fixes #13973
Microsoft Reviewers: Open in CodeFlow