Skip to content

Conversation

@JeremyKuhne
Copy link
Member

@JeremyKuhne JeremyKuhne commented Oct 22, 2025

If the user provided icon matched the size of the small icon we would delete it. Add a regression test.

Fixes #13963

Microsoft Reviewers: Open in CodeFlow

If the user provided icon matched the size of the small icon we would delete it. Add a regression test.
Copy link
Member

@Shyam-Gupta Shyam-Gupta 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.

@JeremyKuhne JeremyKuhne merged commit e68e2fe into dotnet:main Oct 22, 2025
9 checks passed
@JeremyKuhne
Copy link
Member Author

/backport to release/10.0

@github-actions
Copy link
Contributor

Started backporting to release/10.0: https://github.com/dotnet/winforms/actions/runs/18731983854

JeremyKuhne added a commit that referenced this pull request Oct 23, 2025
Backport of #13983 to release/10.0

/cc @JeremyKuhne

## Customer Impact

Users setting a Form Icon that matches the current screen small icon
size will have their Icon disposed, causing an `ObjectDisposedException`
when using the original Icon. There is no easy workaround.

## Testing

Manual testing with user scenario. Regression test.

## Risk

Low, now always creating a new Icon instance.
@codecov
Copy link

codecov bot commented Oct 23, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 77.14691%. Comparing base (f588a2c) to head (5a8acde).
⚠️ Report is 2 commits behind head on main.

Additional details and impacted files
@@                 Coverage Diff                 @@
##                main      #13983         +/-   ##
===================================================
- Coverage   77.14756%   77.14691%   -0.00065%     
===================================================
  Files           3276        3276                 
  Lines         645117      645125          +8     
  Branches       47705       47705                 
===================================================
+ Hits          497692      497694          +2     
- Misses        143739      143751         +12     
+ Partials        3686        3680          -6     
Flag Coverage Δ
Debug 77.14691% <100.00000%> (-0.00065%) ⬇️
integration 18.98257% <75.00000%> (-0.00643%) ⬇️
production 52.00354% <100.00000%> (-0.00259%) ⬇️
test 97.40955% <100.00000%> (+0.00007%) ⬆️
unit 49.42825% <100.00000%> (+0.00050%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@kirsan31
Copy link
Contributor

@JeremyKuhne I left a comment in code about this change that's warry me a bit...

@github-actions github-actions bot locked and limited conversation to collaborators Nov 23, 2025
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.

Access icon failed with exception "Cannot access a disposed object"

4 participants