Skip to content

Win2D XAML controls leak (along with their parent/siblings) unless removed from their parent #658

@BryanFerguson

Description

@BryanFerguson

A small test app here demonstrates the leak.

The Win2D controls currently retain a strong reference to their parent element (m_lastSeenParent), causing a reference cycle that isn't broken unless they're removed from their parent after it's unloaded. The Avoiding memory leaks doc suggests that this removal is only necessary for a managed app/control that doesn't unsubscribe for events from a Win2D control. This isn't accurate: the parent reference retained in support of the RemoveFromVisualTree method introduces a cycle that may only be broken by calling this method or removing the control from its parent by other means.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions