You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
DependencyProperty._getPropertyCache memoizes (targetType, "ns:Owner.Property") -> DP lookups resolved from style and VSM target paths.
When a guest (secondary-ALC) style targets an attached property declared in the guest on a framework element (e.g. Button), the cache gains an entry whose key type lives in the default ALC but whose value (the DP, and its owner type) lives in the guest ALC.
NameToPropertyDictionary.RemoveNonDefaultAlcEntries checks only the key's ALC, so the entry survives ExitAlcApplication()'s sweep and roots the guest's LoaderAllocator. The collectible ALC can then never be collected.
Verified with dotnet-dumpgcroot: the retention path enters through this cache entry.
Expected behavior
After a secondary-ALC app unloads, no entry in _getPropertyCache references a DP whose owner type lives in the unloading context, and the guest's LoaderAllocator becomes collectible.
How to fix
Also check the cached DP value's owner-type ALC in RemoveNonDefaultAlcEntries, or clear this cache wholesale on ALC teardown. It is a pure memoization over DependencyPropertyRegistry, so clearing it is safe and it repopulates on demand.
Host-side workaround in use: clearing _getPropertyCache via reflection after unload.
Environment
Reproduced against Uno.Sdk.Private6.7.0-dev.815 (artifacts/uno @ 21bf1ad6), Skia desktop (X11 + Win32) and browserwasm, hosting the three Uno.Themes sample heads as secondary-ALC guests through AlcContentHost / WindowHelper.ContentHostOverride.
Activity