Skip to content

DataGridView and its elements accessible objects are leaking in memory #7347

@vladimir-krestov

Description

@vladimir-krestov

.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

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

WinDbg snapshot after disposing:
image

Steps to reproduce

  • Create a parent form with two buttons: one will be opening a child form with the DataGridView control and the other will collect the garbage.
  • Press the second button to open the child form with DataGridView .
  • Start the Accessibility Insights tools or Inspect.
  • Run automated checks for the ComboBox control using AI/Inspect.
  • Close the child form.
  • Clear memory with the first button of the parent form.
  • DON'T close the AI/Inspect tool.
  • Update AI/Inspect cached tree to release accessible objects
  • Look for "DataGrid" objects left in memory (using WinDbg, or dotMemory, or another suitable tool).

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

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions