winforms icon indicating copy to clipboard operation
winforms copied to clipboard

Fixing memory leaks of DataGridView elements accessible objects

Open vladimir-krestov opened this issue 3 years ago • 0 comments

Fixes #7347 ⚠️Should be merged after #7319 because uses the ComboBox leaks fix. ⚠️Doesn't fix memory leaks of TextPattern. It will be fixed as another fix for TextBox as well.

Proposed changes

  • Add a call of UiaDisconnectProvider for DataGridView elements (rows, cells, headers) for cases when: DataGridView is destroyed A row is removed from a DataGridView A column is removed from a DataGridView Using TextPattern explorer of Inspect, Narrator

Customer Impact

  • Less memory leaks of DataGridView

Regression?

  • No

Risk

  • Minimal

Screenshots

Before

  • There are some kept object in the memory after disposing a DataGridView: image

After

  • These are no DataGridView elements objects in the memory after disposing (without TextPattern): image

Test methodology

  • CTI
  • Manually (via WinDbg)

Accessibility testing

  • Using AI, Inspect, Narrator

Test environment(s)

  • .NET 7.0 Preview 4
  • Windows 11
Microsoft Reviewers: Open in CodeFlow

vladimir-krestov avatar Jun 25 '22 15:06 vladimir-krestov