Skip to content

ListBox items' accessible objects are leaking in memory #7197

@dmitrii-drobotov

Description

@dmitrii-drobotov

.NET version

.NET 7.0 Preview 4

Did it work in .NET Framework?

No

Did it work in any of the earlier releases of .NET Core or .NET 5+?

No

Issue description

ListBox items' accessible objects are left in memory after the ListBox control instance with its items was inspected with accessibility tool (like Accessibility Insights or Inspect) and the form with ListBox is closed, garbage is collected, but accessibility tool is still opened. Same applies for case when ListBox item is removed from ListBox.

Memory snapshot in VS:
Screenshot 2022-05-18 174214

Steps to reproduce

  1. Create a parent form with two buttons: one will be opening a child form with the ListBox control and the other will collect the garbage.
  2. Press the second button to open the child form with ListBox.
  3. Start the Accessibility Insights tools.
  4. Run automated checks for the ListBox control using AI.
  5. Close the child form.
  6. Clear memory with the first button of the parent form.
  7. DON'T close the AI tool.
  8. Look for ListBoxItemAccessibleObject accessible objects left in memory (using WinDbg, or dotMemory, or another suitable tool).

Sample app: ListBoxSample.zip

Metadata

Metadata

Labels

area-Accessibility-LeaksIssues when control's accessible objects are keeping in memory after disposing of the controltenet-accessibilityMAS violation, UIA issue; problems with accessibility standardstenet-performanceImprove performance, flag performance regressions across core releases

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions