Repository navigation
fix(responsive): release hosts that never load from HardSelfReferences (backport #1684) - #1685
Merged
Merged
Conversation
#1684) Co-authored-by: Claude Opus 5.5 <[email protected]> Co-authored-by: Copilot Autofix powered by AI <[email protected]> Co-authored-by: Steve Bilogan <[email protected]> (cherry picked from commit 71e1615)
6 of 7 tasks
kazo0
approved these changes
Oct 27, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
GitHub Issue (If applicable): closes #1683
PR Type
What is the current behavior?
ResponsiveExtensionadds itself to the staticHardSelfReferenceslist (the uno#14502 workaround).AssemblyLoadContextcan't unload.What is the new behavior?
ConnectWhenLoaded,Connect) hold the host through aWeakReference.SweepDeadInstancesandCleanupIfHostDisposedshare one check,IsHostGone. It falls back to the target's weak reference when the extension never connected.Reviewer's guide
src/Uno.Toolkit.UI/Markup/ResponsiveExtension.cs,IsHostGoneand the twoDisposable.Createclosures.ResponsiveExtensionsLeakTests.NeverLoaded_Host_IsCollectible_AfterSweep. Without the fix it fails onAssert.IsFalse(hostRef.IsAlive).SweepDeadInstances_Prunes_CollectedTrackedInstancesnow takes its baseline count after a collect and sweep, so a dead entry left by another test can't skew it.Connectclosure. The case it guards is a connected host dropped withoutUnloaded, which the harness can't fake.ColumnDefinitionon aGridthat never loads.PR Checklist
net10.0-desktopOther information
Runtime tests, desktop, Debug, filter
Responsive: 12 passed, 2 failed, 7 skipped. The 2 failures areResponsiveHelperLeakTests.Reset_TearsDown_DefaultProviderandDefaultProvider_IsCollectible_WhileXamlRootAlive. Both time out waiting for "Border loaded", and fail the same way without this change.🤖 Generated with Claude Code
This is an automatic backport of pull request #1684 done by [Mergify](https://mergify.com).